//===----------------------------------------------------------------------===//
//
// This source file is part of the Soto for AWS open source project
//
// Copyright (c) 2017-2021 the Soto project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
// See CONTRIBUTORS.txt for the list of Soto project authors
//
// SPDX-License-Identifier: Apache-2.0
//
//===----------------------------------------------------------------------===//

// THIS FILE IS AUTOMATICALLY GENERATED by https://github.com/soto-project/soto/tree/main/CodeGenerator. DO NOT EDIT.

import Foundation
import SotoCore

extension WorkMail {
    // MARK: Enums

    public enum AccessControlRuleEffect: String, CustomStringConvertible, Codable {
        case allow = "ALLOW"
        case deny = "DENY"
        public var description: String { return self.rawValue }
    }

    public enum EntityState: String, CustomStringConvertible, Codable {
        case deleted = "DELETED"
        case disabled = "DISABLED"
        case enabled = "ENABLED"
        public var description: String { return self.rawValue }
    }

    public enum FolderName: String, CustomStringConvertible, Codable {
        case deletedItems = "DELETED_ITEMS"
        case drafts = "DRAFTS"
        case inbox = "INBOX"
        case junkEmail = "JUNK_EMAIL"
        case sentItems = "SENT_ITEMS"
        public var description: String { return self.rawValue }
    }

    public enum MailboxExportJobState: String, CustomStringConvertible, Codable {
        case cancelled = "CANCELLED"
        case completed = "COMPLETED"
        case failed = "FAILED"
        case running = "RUNNING"
        public var description: String { return self.rawValue }
    }

    public enum MemberType: String, CustomStringConvertible, Codable {
        case group = "GROUP"
        case user = "USER"
        public var description: String { return self.rawValue }
    }

    public enum PermissionType: String, CustomStringConvertible, Codable {
        case fullAccess = "FULL_ACCESS"
        case sendAs = "SEND_AS"
        case sendOnBehalf = "SEND_ON_BEHALF"
        public var description: String { return self.rawValue }
    }

    public enum ResourceType: String, CustomStringConvertible, Codable {
        case equipment = "EQUIPMENT"
        case room = "ROOM"
        public var description: String { return self.rawValue }
    }

    public enum RetentionAction: String, CustomStringConvertible, Codable {
        case delete = "DELETE"
        case none = "NONE"
        case permanentlyDelete = "PERMANENTLY_DELETE"
        public var description: String { return self.rawValue }
    }

    public enum UserRole: String, CustomStringConvertible, Codable {
        case resource = "RESOURCE"
        case systemUser = "SYSTEM_USER"
        case user = "USER"
        public var description: String { return self.rawValue }
    }

    // MARK: Shapes

    public struct AccessControlRule: AWSDecodableShape {
        /// Access protocol actions to include in the rule. Valid values include ActiveSync, AutoDiscover, EWS, IMAP, SMTP, WindowsOutlook, and WebMail.
        public let actions: [String]?
        /// The date that the rule was created.
        public let dateCreated: Date?
        /// The date that the rule was modified.
        public let dateModified: Date?
        /// The rule description.
        public let description: String?
        /// The rule effect.
        public let effect: AccessControlRuleEffect?
        /// IPv4 CIDR ranges to include in the rule.
        public let ipRanges: [String]?
        /// The rule name.
        public let name: String?
        /// Access protocol actions to exclude from the rule. Valid values include ActiveSync, AutoDiscover, EWS, IMAP, SMTP, WindowsOutlook, and WebMail.
        public let notActions: [String]?
        /// IPv4 CIDR ranges to exclude from the rule.
        public let notIpRanges: [String]?
        /// User IDs to exclude from the rule.
        public let notUserIds: [String]?
        /// User IDs to include in the rule.
        public let userIds: [String]?

        public init(actions: [String]? = nil, dateCreated: Date? = nil, dateModified: Date? = nil, description: String? = nil, effect: AccessControlRuleEffect? = nil, ipRanges: [String]? = nil, name: String? = nil, notActions: [String]? = nil, notIpRanges: [String]? = nil, notUserIds: [String]? = nil, userIds: [String]? = nil) {
            self.actions = actions
            self.dateCreated = dateCreated
            self.dateModified = dateModified
            self.description = description
            self.effect = effect
            self.ipRanges = ipRanges
            self.name = name
            self.notActions = notActions
            self.notIpRanges = notIpRanges
            self.notUserIds = notUserIds
            self.userIds = userIds
        }

        private enum CodingKeys: String, CodingKey {
            case actions = "Actions"
            case dateCreated = "DateCreated"
            case dateModified = "DateModified"
            case description = "Description"
            case effect = "Effect"
            case ipRanges = "IpRanges"
            case name = "Name"
            case notActions = "NotActions"
            case notIpRanges = "NotIpRanges"
            case notUserIds = "NotUserIds"
            case userIds = "UserIds"
        }
    }

    public struct AssociateDelegateToResourceRequest: AWSEncodableShape {
        /// The member (user or group) to associate to the resource.
        public let entityId: String
        /// The organization under which the resource exists.
        public let organizationId: String
        /// The resource for which members (users or groups) are associated.
        public let resourceId: String

        public init(entityId: String, organizationId: String, resourceId: String) {
            self.entityId = entityId
            self.organizationId = organizationId
            self.resourceId = resourceId
        }

        public func validate(name: String) throws {
            try self.validate(self.entityId, name: "entityId", parent: name, max: 256)
            try self.validate(self.entityId, name: "entityId", parent: name, min: 12)
            try self.validate(self.organizationId, name: "organizationId", parent: name, max: 34)
            try self.validate(self.organizationId, name: "organizationId", parent: name, min: 34)
            try self.validate(self.organizationId, name: "organizationId", parent: name, pattern: "^m-[0-9a-f]{32}$")
            try self.validate(self.resourceId, name: "resourceId", parent: name, max: 34)
            try self.validate(self.resourceId, name: "resourceId", parent: name, min: 34)
            try self.validate(self.resourceId, name: "resourceId", parent: name, pattern: "^r-[0-9a-f]{32}$")
        }

        private enum CodingKeys: String, CodingKey {
            case entityId = "EntityId"
            case organizationId = "OrganizationId"
            case resourceId = "ResourceId"
        }
    }

    public struct AssociateDelegateToResourceResponse: AWSDecodableShape {
        public init() {}
    }

    public struct AssociateMemberToGroupRequest: AWSEncodableShape {
        /// The group to which the member (user or group) is associated.
        public let groupId: String
        /// The member (user or group) to associate to the group.
        public let memberId: String
        /// The organization under which the group exists.
        public let organizationId: String

        public init(groupId: String, memberId: String, organizationId: String) {
            self.groupId = groupId
            self.memberId = memberId
            self.organizationId = organizationId
        }

        public func validate(name: String) throws {
            try self.validate(self.groupId, name: "groupId", parent: name, max: 256)
            try self.validate(self.groupId, name: "groupId", parent: name, min: 12)
            try self.validate(self.memberId, name: "memberId", parent: name, max: 256)
            try self.validate(self.memberId, name: "memberId", parent: name, min: 12)
            try self.validate(self.organizationId, name: "organizationId", parent: name, max: 34)
            try self.validate(self.organizationId, name: "organizationId", parent: name, min: 34)
            try self.validate(self.organizationId, name: "organizationId", parent: name, pattern: "^m-[0-9a-f]{32}$")
        }

        private enum CodingKeys: String, CodingKey {
            case groupId = "GroupId"
            case memberId = "MemberId"
            case organizationId = "OrganizationId"
        }
    }

    public struct AssociateMemberToGroupResponse: AWSDecodableShape {
        public init() {}
    }

    public struct BookingOptions: AWSEncodableShape & AWSDecodableShape {
        /// The resource's ability to automatically reply to requests. If disabled, delegates must be associated to the resource.
        public let autoAcceptRequests: Bool?
        /// The resource's ability to automatically decline any conflicting requests.
        public let autoDeclineConflictingRequests: Bool?
        /// The resource's ability to automatically decline any recurring requests.
        public let autoDeclineRecurringRequests: Bool?

        public init(autoAcceptRequests: Bool? = nil, autoDeclineConflictingRequests: Bool? = nil, autoDeclineRecurringRequests: Bool? = nil) {
            self.autoAcceptRequests = autoAcceptRequests
            self.autoDeclineConflictingRequests = autoDeclineConflictingRequests
            self.autoDeclineRecurringRequests = autoDeclineRecurringRequests
        }

        private enum CodingKeys: String, CodingKey {
            case autoAcceptRequests = "AutoAcceptRequests"
            case autoDeclineConflictingRequests = "AutoDeclineConflictingRequests"
            case autoDeclineRecurringRequests = "AutoDeclineRecurringRequests"
        }
    }

    public struct CancelMailboxExportJobRequest: AWSEncodableShape {
        /// The idempotency token for the client request.
        public let clientToken: String
        /// The job ID.
        public let jobId: String
        /// The organization ID.
        public let organizationId: String

        public init(clientToken: String = CancelMailboxExportJobRequest.idempotencyToken(), jobId: String, organizationId: String) {
            self.clientToken = clientToken
            self.jobId = jobId
            self.organizationId = organizationId
        }

        public func validate(name: String) throws {
            try self.validate(self.clientToken, name: "clientToken", parent: name, max: 128)
            try self.validate(self.clientToken, name: "clientToken", parent: name, min: 1)
            try self.validate(self.clientToken, name: "clientToken", parent: name, pattern: "[\\x21-\\x7e]+")
            try self.validate(self.jobId, name: "jobId", parent: name, max: 63)
            try self.validate(self.jobId, name: "jobId", parent: name, min: 1)
            try self.validate(self.jobId, name: "jobId", parent: name, pattern: "[A-Za-z0-9-]+")
            try self.validate(self.organizationId, name: "organizationId", parent: name, max: 34)
            try self.validate(self.organizationId, name: "organizationId", parent: name, min: 34)
            try self.validate(self.organizationId, name: "organizationId", parent: name, pattern: "^m-[0-9a-f]{32}$")
        }

        private enum CodingKeys: String, CodingKey {
            case clientToken = "ClientToken"
            case jobId = "JobId"
            case organizationId = "OrganizationId"
        }
    }

    public struct CancelMailboxExportJobResponse: AWSDecodableShape {
        public init() {}
    }

    public struct CreateAliasRequest: AWSEncodableShape {
        /// The alias to add to the member set.
        public let alias: String
        /// The member (user or group) to which this alias is added.
        public let entityId: String
        /// The organization under which the member (user or group) exists.
        public let organizationId: String

        public init(alias: String, entityId: String, organizationId: String) {
            self.alias = alias
            self.entityId = entityId
            self.organizationId = organizationId
        }

        public func validate(name: String) throws {
            try self.validate(self.alias, name: "alias", parent: name, max: 254)
            try self.validate(self.alias, name: "alias", parent: name, min: 1)
            try self.validate(self.alias, name: "alias", parent: name, pattern: "[a-zA-Z0-9._%+-]{1,64}@[a-zA-Z0-9.-]+\\.[a-zA-Z-]{2,}")
            try self.validate(self.entityId, name: "entityId", parent: name, max: 256)
            try self.validate(self.entityId, name: "entityId", parent: name, min: 12)
            try self.validate(self.organizationId, name: "organizationId", parent: name, max: 34)
            try self.validate(self.organizationId, name: "organizationId", parent: name, min: 34)
            try self.validate(self.organizationId, name: "organizationId", parent: name, pattern: "^m-[0-9a-f]{32}$")
        }

        private enum CodingKeys: String, CodingKey {
            case alias = "Alias"
            case entityId = "EntityId"
            case organizationId = "OrganizationId"
        }
    }

    public struct CreateAliasResponse: AWSDecodableShape {
        public init() {}
    }

    public struct CreateGroupRequest: AWSEncodableShape {
        /// The name of the group.
        public let name: String
        /// The organization under which the group is to be created.
        public let organizationId: String

        public init(name: String, organizationId: String) {
            self.name = name
            self.organizationId = organizationId
        }

        public func validate(name: String) throws {
            try self.validate(self.name, name: "name", parent: name, max: 256)
            try self.validate(self.name, name: "name", parent: name, min: 1)
            try self.validate(self.name, name: "name", parent: name, pattern: "[\\u0020-\\u00FF]+")
            try self.validate(self.organizationId, name: "organizationId", parent: name, max: 34)
            try self.validate(self.organizationId, name: "organizationId", parent: name, min: 34)
            try self.validate(self.organizationId, name: "organizationId", parent: name, pattern: "^m-[0-9a-f]{32}$")
        }

        private enum CodingKeys: String, CodingKey {
            case name = "Name"
            case organizationId = "OrganizationId"
        }
    }

    public struct CreateGroupResponse: AWSDecodableShape {
        /// The identifier of the group.
        public let groupId: String?

        public init(groupId: String? = nil) {
            self.groupId = groupId
        }

        private enum CodingKeys: String, CodingKey {
            case groupId = "GroupId"
        }
    }

    public struct CreateOrganizationRequest: AWSEncodableShape {
        /// The organization alias.
        public let alias: String
        /// The idempotency token associated with the request.
        public let clientToken: String?
        /// The AWS Directory Service directory ID.
        public let directoryId: String?
        /// The email domains to associate with the organization.
        public let domains: [Domain]?
        /// When true, allows organization interoperability between Amazon WorkMail and Microsoft Exchange. Can only be set to true if an AD Connector directory ID is included in the request.
        public let enableInteroperability: Bool?
        /// The Amazon Resource Name (ARN) of a customer managed master key from AWS KMS.
        public let kmsKeyArn: String?

        public init(alias: String, clientToken: String? = CreateOrganizationRequest.idempotencyToken(), directoryId: String? = nil, domains: [Domain]? = nil, enableInteroperability: Bool? = nil, kmsKeyArn: String? = nil) {
            self.alias = alias
            self.clientToken = clientToken
            self.directoryId = directoryId
            self.domains = domains
            self.enableInteroperability = enableInteroperability
            self.kmsKeyArn = kmsKeyArn
        }

        public func validate(name: String) throws {
            try self.validate(self.alias, name: "alias", parent: name, max: 62)
            try self.validate(self.alias, name: "alias", parent: name, min: 1)
            try self.validate(self.alias, name: "alias", parent: name, pattern: "^(?!d-)([\\da-zA-Z]+)([-][\\da-zA-Z]+)*")
            try self.validate(self.clientToken, name: "clientToken", parent: name, max: 128)
            try self.validate(self.clientToken, name: "clientToken", parent: name, min: 1)
            try self.validate(self.clientToken, name: "clientToken", parent: name, pattern: "[\\x21-\\x7e]+")
            try self.validate(self.directoryId, name: "directoryId", parent: name, max: 12)
            try self.validate(self.directoryId, name: "directoryId", parent: name, min: 12)
            try self.validate(self.directoryId, name: "directoryId", parent: name, pattern: "^d-[0-9a-f]{10}$")
            try self.domains?.forEach {
                try $0.validate(name: "\(name).domains[]")
            }
            try self.validate(self.domains, name: "domains", parent: name, max: 5)
            try self.validate(self.domains, name: "domains", parent: name, min: 0)
            try self.validate(self.kmsKeyArn, name: "kmsKeyArn", parent: name, max: 2048)
            try self.validate(self.kmsKeyArn, name: "kmsKeyArn", parent: name, min: 20)
            try self.validate(self.kmsKeyArn, name: "kmsKeyArn", parent: name, pattern: "arn:aws:kms:[a-z0-9-]*:[a-z0-9-]+:[A-Za-z0-9][A-Za-z0-9:_/+=,@.-]{0,1023}")
        }

        private enum CodingKeys: String, CodingKey {
            case alias = "Alias"
            case clientToken = "ClientToken"
            case directoryId = "DirectoryId"
            case domains = "Domains"
            case enableInteroperability = "EnableInteroperability"
            case kmsKeyArn = "KmsKeyArn"
        }
    }

    public struct CreateOrganizationResponse: AWSDecodableShape {
        /// The organization ID.
        public let organizationId: String?

        public init(organizationId: String? = nil) {
            self.organizationId = organizationId
        }

        private enum CodingKeys: String, CodingKey {
            case organizationId = "OrganizationId"
        }
    }

    public struct CreateResourceRequest: AWSEncodableShape {
        /// The name of the new resource.
        public let name: String
        /// The identifier associated with the organization for which the resource is created.
        public let organizationId: String
        /// The type of the new resource. The available types are equipment and room.
        public let type: ResourceType

        public init(name: String, organizationId: String, type: ResourceType) {
            self.name = name
            self.organizationId = organizationId
            self.type = type
        }

        public func validate(name: String) throws {
            try self.validate(self.name, name: "name", parent: name, max: 20)
            try self.validate(self.name, name: "name", parent: name, min: 1)
            try self.validate(self.name, name: "name", parent: name, pattern: "[\\w\\-.]+(@[a-zA-Z0-9.\\-]+\\.[a-zA-Z0-9-]{2,})?")
            try self.validate(self.organizationId, name: "organizationId", parent: name, max: 34)
            try self.validate(self.organizationId, name: "organizationId", parent: name, min: 34)
            try self.validate(self.organizationId, name: "organizationId", parent: name, pattern: "^m-[0-9a-f]{32}$")
        }

        private enum CodingKeys: String, CodingKey {
            case name = "Name"
            case organizationId = "OrganizationId"
            case type = "Type"
        }
    }

    public struct CreateResourceResponse: AWSDecodableShape {
        /// The identifier of the new resource.
        public let resourceId: String?

        public init(resourceId: String? = nil) {
            self.resourceId = resourceId
        }

        private enum CodingKeys: String, CodingKey {
            case resourceId = "ResourceId"
        }
    }

    public struct CreateUserRequest: AWSEncodableShape {
        /// The display name for the new user.
        public let displayName: String
        /// The name for the new user. WorkMail directory user names have a maximum length of 64. All others have a maximum length of 20.
        public let name: String
        /// The identifier of the organization for which the user is created.
        public let organizationId: String
        /// The password for the new user.
        public let password: String

        public init(displayName: String, name: String, organizationId: String, password: String) {
            self.displayName = displayName
            self.name = name
            self.organizationId = organizationId
            self.password = password
        }

        public func validate(name: String) throws {
            try self.validate(self.displayName, name: "displayName", parent: name, max: 256)
            try self.validate(self.name, name: "name", parent: name, max: 64)
            try self.validate(self.name, name: "name", parent: name, min: 1)
            try self.validate(self.name, name: "name", parent: name, pattern: "[\\w\\-.]+(@[a-zA-Z0-9.\\-]+\\.[a-zA-Z0-9-]{2,})?")
            try self.validate(self.organizationId, name: "organizationId", parent: name, max: 34)
            try self.validate(self.organizationId, name: "organizationId", parent: name, min: 34)
            try self.validate(self.organizationId, name: "organizationId", parent: name, pattern: "^m-[0-9a-f]{32}$")
            try self.validate(self.password, name: "password", parent: name, max: 256)
            try self.validate(self.password, name: "password", parent: name, pattern: "[\\u0020-\\u00FF]+")
        }

        private enum CodingKeys: String, CodingKey {
            case displayName = "DisplayName"
            case name = "Name"
            case organizationId = "OrganizationId"
            case password = "Password"
        }
    }

    public struct CreateUserResponse: AWSDecodableShape {
        /// The identifier for the new user.
        public let userId: String?

        public init(userId: String? = nil) {
            self.userId = userId
        }

        private enum CodingKeys: String, CodingKey {
            case userId = "UserId"
        }
    }

    public struct Delegate: AWSDecodableShape {
        /// The identifier for the user or group associated as the resource's delegate.
        public let id: String
        /// The type of the delegate: user or group.
        public let type: MemberType

        public init(id: String, type: MemberType) {
            self.id = id
            self.type = type
        }

        private enum CodingKeys: String, CodingKey {
            case id = "Id"
            case type = "Type"
        }
    }

    public struct DeleteAccessControlRuleRequest: AWSEncodableShape {
        /// The name of the access control rule.
        public let name: String
        /// The identifier for the organization.
        public let organizationId: String

        public init(name: String, organizationId: String) {
            self.name = name
            self.organizationId = organizationId
        }

        public func validate(name: String) throws {
            try self.validate(self.name, name: "name", parent: name, max: 64)
            try self.validate(self.name, name: "name", parent: name, min: 1)
            try self.validate(self.name, name: "name", parent: name, pattern: "[a-zA-Z0-9_-]+")
            try self.validate(self.organizationId, name: "organizationId", parent: name, max: 34)
            try self.validate(self.organizationId, name: "organizationId", parent: name, min: 34)
            try self.validate(self.organizationId, name: "organizationId", parent: name, pattern: "^m-[0-9a-f]{32}$")
        }

        private enum CodingKeys: String, CodingKey {
            case name = "Name"
            case organizationId = "OrganizationId"
        }
    }

    public struct DeleteAccessControlRuleResponse: AWSDecodableShape {
        public init() {}
    }

    public struct DeleteAliasRequest: AWSEncodableShape {
        /// The aliases to be removed from the user's set of aliases. Duplicate entries in the list are collapsed into single entries (the list is transformed into a set).
        public let alias: String
        /// The identifier for the member (user or group) from which to have the aliases removed.
        public let entityId: String
        /// The identifier for the organization under which the user exists.
        public let organizationId: String

        public init(alias: String, entityId: String, organizationId: String) {
            self.alias = alias
            self.entityId = entityId
            self.organizationId = organizationId
        }

        public func validate(name: String) throws {
            try self.validate(self.alias, name: "alias", parent: name, max: 254)
            try self.validate(self.alias, name: "alias", parent: name, min: 1)
            try self.validate(self.alias, name: "alias", parent: name, pattern: "[a-zA-Z0-9._%+-]{1,64}@[a-zA-Z0-9.-]+\\.[a-zA-Z-]{2,}")
            try self.validate(self.entityId, name: "entityId", parent: name, max: 256)
            try self.validate(self.entityId, name: "entityId", parent: name, min: 12)
            try self.validate(self.organizationId, name: "organizationId", parent: name, max: 34)
            try self.validate(self.organizationId, name: "organizationId", parent: name, min: 34)
            try self.validate(self.organizationId, name: "organizationId", parent: name, pattern: "^m-[0-9a-f]{32}$")
        }

        private enum CodingKeys: String, CodingKey {
            case alias = "Alias"
            case entityId = "EntityId"
            case organizationId = "OrganizationId"
        }
    }

    public struct DeleteAliasResponse: AWSDecodableShape {
        public init() {}
    }

    public struct DeleteGroupRequest: AWSEncodableShape {
        /// The identifier of the group to be deleted.
        public let groupId: String
        /// The organization that contains the group.
        public let organizationId: String

        public init(groupId: String, organizationId: String) {
            self.groupId = groupId
            self.organizationId = organizationId
        }

        public func validate(name: String) throws {
            try self.validate(self.groupId, name: "groupId", parent: name, max: 256)
            try self.validate(self.groupId, name: "groupId", parent: name, min: 12)
            try self.validate(self.organizationId, name: "organizationId", parent: name, max: 34)
            try self.validate(self.organizationId, name: "organizationId", parent: name, min: 34)
            try self.validate(self.organizationId, name: "organizationId", parent: name, pattern: "^m-[0-9a-f]{32}$")
        }

        private enum CodingKeys: String, CodingKey {
            case groupId = "GroupId"
            case organizationId = "OrganizationId"
        }
    }

    public struct DeleteGroupResponse: AWSDecodableShape {
        public init() {}
    }

    public struct DeleteMailboxPermissionsRequest: AWSEncodableShape {
        /// The identifier of the member (user or group) that owns the mailbox.
        public let entityId: String
        /// The identifier of the member (user or group) for which to delete granted permissions.
        public let granteeId: String
        /// The identifier of the organization under which the member (user or group) exists.
        public let organizationId: String

        public init(entityId: String, granteeId: String, organizationId: String) {
            self.entityId = entityId
            self.granteeId = granteeId
            self.organizationId = organizationId
        }

        public func validate(name: String) throws {
            try self.validate(self.entityId, name: "entityId", parent: name, max: 256)
            try self.validate(self.entityId, name: "entityId", parent: name, min: 12)
            try self.validate(self.granteeId, name: "granteeId", parent: name, max: 256)
            try self.validate(self.granteeId, name: "granteeId", parent: name, min: 12)
            try self.validate(self.organizationId, name: "organizationId", parent: name, max: 34)
            try self.validate(self.organizationId, name: "organizationId", parent: name, min: 34)
            try self.validate(self.organizationId, name: "organizationId", parent: name, pattern: "^m-[0-9a-f]{32}$")
        }

        private enum CodingKeys: String, CodingKey {
            case entityId = "EntityId"
            case granteeId = "GranteeId"
            case organizationId = "OrganizationId"
        }
    }

    public struct DeleteMailboxPermissionsResponse: AWSDecodableShape {
        public init() {}
    }

    public struct DeleteOrganizationRequest: AWSEncodableShape {
        /// The idempotency token associated with the request.
        public let clientToken: String?
        /// If true, deletes the AWS Directory Service directory associated with the organization.
        public let deleteDirectory: Bool
        /// The organization ID.
        public let organizationId: String

        public init(clientToken: String? = DeleteOrganizationRequest.idempotencyToken(), deleteDirectory: Bool, organizationId: String) {
            self.clientToken = clientToken
            self.deleteDirectory = deleteDirectory
            self.organizationId = organizationId
        }

        public func validate(name: String) throws {
            try self.validate(self.clientToken, name: "clientToken", parent: name, max: 128)
            try self.validate(self.clientToken, name: "clientToken", parent: name, min: 1)
            try self.validate(self.clientToken, name: "clientToken", parent: name, pattern: "[\\x21-\\x7e]+")
            try self.validate(self.organizationId, name: "organizationId", parent: name, max: 34)
            try self.validate(self.organizationId, name: "organizationId", parent: name, min: 34)
            try self.validate(self.organizationId, name: "organizationId", parent: name, pattern: "^m-[0-9a-f]{32}$")
        }

        private enum CodingKeys: String, CodingKey {
            case clientToken = "ClientToken"
            case deleteDirectory = "DeleteDirectory"
            case organizationId = "OrganizationId"
        }
    }

    public struct DeleteOrganizationResponse: AWSDecodableShape {
        /// The organization ID.
        public let organizationId: String?
        /// The state of the organization.
        public let state: String?

        public init(organizationId: String? = nil, state: String? = nil) {
            self.organizationId = organizationId
            self.state = state
        }

        private enum CodingKeys: String, CodingKey {
            case organizationId = "OrganizationId"
            case state = "State"
        }
    }

    public struct DeleteResourceRequest: AWSEncodableShape {
        /// The identifier associated with the organization from which the resource is deleted.
        public let organizationId: String
        /// The identifier of the resource to be deleted.
        public let resourceId: String

        public init(organizationId: String, resourceId: String) {
            self.organizationId = organizationId
            self.resourceId = resourceId
        }

        public func validate(name: String) throws {
            try self.validate(self.organizationId, name: "organizationId", parent: name, max: 34)
            try self.validate(self.organizationId, name: "organizationId", parent: name, min: 34)
            try self.validate(self.organizationId, name: "organizationId", parent: name, pattern: "^m-[0-9a-f]{32}$")
            try self.validate(self.resourceId, name: "resourceId", parent: name, max: 34)
            try self.validate(self.resourceId, name: "resourceId", parent: name, min: 34)
            try self.validate(self.resourceId, name: "resourceId", parent: name, pattern: "^r-[0-9a-f]{32}$")
        }

        private enum CodingKeys: String, CodingKey {
            case organizationId = "OrganizationId"
            case resourceId = "ResourceId"
        }
    }

    public struct DeleteResourceResponse: AWSDecodableShape {
        public init() {}
    }

    public struct DeleteRetentionPolicyRequest: AWSEncodableShape {
        /// The retention policy ID.
        public let id: String
        /// The organization ID.
        public let organizationId: String

        public init(id: String, organizationId: String) {
            self.id = id
            self.organizationId = organizationId
        }

        public func validate(name: String) throws {
            try self.validate(self.id, name: "id", parent: name, max: 64)
            try self.validate(self.id, name: "id", parent: name, min: 1)
            try self.validate(self.id, name: "id", parent: name, pattern: "[a-zA-Z0-9_-]+")
            try self.validate(self.organizationId, name: "organizationId", parent: name, max: 34)
            try self.validate(self.organizationId, name: "organizationId", parent: name, min: 34)
            try self.validate(self.organizationId, name: "organizationId", parent: name, pattern: "^m-[0-9a-f]{32}$")
        }

        private enum CodingKeys: String, CodingKey {
            case id = "Id"
            case organizationId = "OrganizationId"
        }
    }

    public struct DeleteRetentionPolicyResponse: AWSDecodableShape {
        public init() {}
    }

    public struct DeleteUserRequest: AWSEncodableShape {
        /// The organization that contains the user to be deleted.
        public let organizationId: String
        /// The identifier of the user to be deleted.
        public let userId: String

        public init(organizationId: String, userId: String) {
            self.organizationId = organizationId
            self.userId = userId
        }

        public func validate(name: String) throws {
            try self.validate(self.organizationId, name: "organizationId", parent: name, max: 34)
            try self.validate(self.organizationId, name: "organizationId", parent: name, min: 34)
            try self.validate(self.organizationId, name: "organizationId", parent: name, pattern: "^m-[0-9a-f]{32}$")
            try self.validate(self.userId, name: "userId", parent: name, max: 256)
            try self.validate(self.userId, name: "userId", parent: name, min: 12)
        }

        private enum CodingKeys: String, CodingKey {
            case organizationId = "OrganizationId"
            case userId = "UserId"
        }
    }

    public struct DeleteUserResponse: AWSDecodableShape {
        public init() {}
    }

    public struct DeregisterFromWorkMailRequest: AWSEncodableShape {
        /// The identifier for the member (user or group) to be updated.
        public let entityId: String
        /// The identifier for the organization under which the Amazon WorkMail entity exists.
        public let organizationId: String

        public init(entityId: String, organizationId: String) {
            self.entityId = entityId
            self.organizationId = organizationId
        }

        public func validate(name: String) throws {
            try self.validate(self.entityId, name: "entityId", parent: name, max: 256)
            try self.validate(self.entityId, name: "entityId", parent: name, min: 12)
            try self.validate(self.organizationId, name: "organizationId", parent: name, max: 34)
            try self.validate(self.organizationId, name: "organizationId", parent: name, min: 34)
            try self.validate(self.organizationId, name: "organizationId", parent: name, pattern: "^m-[0-9a-f]{32}$")
        }

        private enum CodingKeys: String, CodingKey {
            case entityId = "EntityId"
            case organizationId = "OrganizationId"
        }
    }

    public struct DeregisterFromWorkMailResponse: AWSDecodableShape {
        public init() {}
    }

    public struct DescribeGroupRequest: AWSEncodableShape {
        /// The identifier for the group to be described.
        public let groupId: String
        /// The identifier for the organization under which the group exists.
        public let organizationId: String

        public init(groupId: String, organizationId: String) {
            self.groupId = groupId
            self.organizationId = organizationId
        }

        public func validate(name: String) throws {
            try self.validate(self.groupId, name: "groupId", parent: name, max: 256)
            try self.validate(self.groupId, name: "groupId", parent: name, min: 12)
            try self.validate(self.organizationId, name: "organizationId", parent: name, max: 34)
            try self.validate(self.organizationId, name: "organizationId", parent: name, min: 34)
            try self.validate(self.organizationId, name: "organizationId", parent: name, pattern: "^m-[0-9a-f]{32}$")
        }

        private enum CodingKeys: String, CodingKey {
            case groupId = "GroupId"
            case organizationId = "OrganizationId"
        }
    }

    public struct DescribeGroupResponse: AWSDecodableShape {
        /// The date and time when a user was deregistered from WorkMail, in UNIX epoch time format.
        public let disabledDate: Date?
        /// The email of the described group.
        public let email: String?
        /// The date and time when a user was registered to WorkMail, in UNIX epoch time format.
        public let enabledDate: Date?
        /// The identifier of the described group.
        public let groupId: String?
        /// The name of the described group.
        public let name: String?
        /// The state of the user: enabled (registered to Amazon WorkMail) or disabled (deregistered or never registered to WorkMail).
        public let state: EntityState?

        public init(disabledDate: Date? = nil, email: String? = nil, enabledDate: Date? = nil, groupId: String? = nil, name: String? = nil, state: EntityState? = nil) {
            self.disabledDate = disabledDate
            self.email = email
            self.enabledDate = enabledDate
            self.groupId = groupId
            self.name = name
            self.state = state
        }

        private enum CodingKeys: String, CodingKey {
            case disabledDate = "DisabledDate"
            case email = "Email"
            case enabledDate = "EnabledDate"
            case groupId = "GroupId"
            case name = "Name"
            case state = "State"
        }
    }

    public struct DescribeMailboxExportJobRequest: AWSEncodableShape {
        /// The mailbox export job ID.
        public let jobId: String
        /// The organization ID.
        public let organizationId: String

        public init(jobId: String, organizationId: String) {
            self.jobId = jobId
            self.organizationId = organizationId
        }

        public func validate(name: String) throws {
            try self.validate(self.jobId, name: "jobId", parent: name, max: 63)
            try self.validate(self.jobId, name: "jobId", parent: name, min: 1)
            try self.validate(self.jobId, name: "jobId", parent: name, pattern: "[A-Za-z0-9-]+")
            try self.validate(self.organizationId, name: "organizationId", parent: name, max: 34)
            try self.validate(self.organizationId, name: "organizationId", parent: name, min: 34)
            try self.validate(self.organizationId, name: "organizationId", parent: name, pattern: "^m-[0-9a-f]{32}$")
        }

        private enum CodingKeys: String, CodingKey {
            case jobId = "JobId"
            case organizationId = "OrganizationId"
        }
    }

    public struct DescribeMailboxExportJobResponse: AWSDecodableShape {
        /// The mailbox export job description.
        public let description: String?
        /// The mailbox export job end timestamp.
        public let endTime: Date?
        /// The identifier of the user or resource associated with the mailbox.
        public let entityId: String?
        /// Error information for failed mailbox export jobs.
        public let errorInfo: String?
        /// The estimated progress of the mailbox export job, in percentage points.
        public let estimatedProgress: Int?
        /// The Amazon Resource Name (ARN) of the symmetric AWS Key Management Service (AWS KMS) key that encrypts the exported mailbox content.
        public let kmsKeyArn: String?
        /// The ARN of the AWS Identity and Access Management (IAM) role that grants write permission to the Amazon Simple Storage Service (Amazon S3) bucket.
        public let roleArn: String?
        /// The name of the S3 bucket.
        public let s3BucketName: String?
        /// The path to the S3 bucket and file that the mailbox export job is exporting to.
        public let s3Path: String?
        /// The S3 bucket prefix.
        public let s3Prefix: String?
        /// The mailbox export job start timestamp.
        public let startTime: Date?
        /// The state of the mailbox export job.
        public let state: MailboxExportJobState?

        public init(description: String? = nil, endTime: Date? = nil, entityId: String? = nil, errorInfo: String? = nil, estimatedProgress: Int? = nil, kmsKeyArn: String? = nil, roleArn: String? = nil, s3BucketName: String? = nil, s3Path: String? = nil, s3Prefix: String? = nil, startTime: Date? = nil, state: MailboxExportJobState? = nil) {
            self.description = description
            self.endTime = endTime
            self.entityId = entityId
            self.errorInfo = errorInfo
            self.estimatedProgress = estimatedProgress
            self.kmsKeyArn = kmsKeyArn
            self.roleArn = roleArn
            self.s3BucketName = s3BucketName
            self.s3Path = s3Path
            self.s3Prefix = s3Prefix
            self.startTime = startTime
            self.state = state
        }

        private enum CodingKeys: String, CodingKey {
            case description = "Description"
            case endTime = "EndTime"
            case entityId = "EntityId"
            case errorInfo = "ErrorInfo"
            case estimatedProgress = "EstimatedProgress"
            case kmsKeyArn = "KmsKeyArn"
            case roleArn = "RoleArn"
            case s3BucketName = "S3BucketName"
            case s3Path = "S3Path"
            case s3Prefix = "S3Prefix"
            case startTime = "StartTime"
            case state = "State"
        }
    }

    public struct DescribeOrganizationRequest: AWSEncodableShape {
        /// The identifier for the organization to be described.
        public let organizationId: String

        public init(organizationId: String) {
            self.organizationId = organizationId
        }

        public func validate(name: String) throws {
            try self.validate(self.organizationId, name: "organizationId", parent: name, max: 34)
            try self.validate(self.organizationId, name: "organizationId", parent: name, min: 34)
            try self.validate(self.organizationId, name: "organizationId", parent: name, pattern: "^m-[0-9a-f]{32}$")
        }

        private enum CodingKeys: String, CodingKey {
            case organizationId = "OrganizationId"
        }
    }

    public struct DescribeOrganizationResponse: AWSDecodableShape {
        /// The alias for an organization.
        public let alias: String?
        /// The Amazon Resource Name (ARN) of the organization.
        public let arn: String?
        /// The date at which the organization became usable in the WorkMail context, in UNIX epoch time format.
        public let completedDate: Date?
        /// The default mail domain associated with the organization.
        public let defaultMailDomain: String?
        /// The identifier for the directory associated with an Amazon WorkMail organization.
        public let directoryId: String?
        /// The type of directory associated with the WorkMail organization.
        public let directoryType: String?
        /// (Optional) The error message indicating if unexpected behavior was encountered with regards to the organization.
        public let errorMessage: String?
        /// The identifier of an organization.
        public let organizationId: String?
        /// The state of an organization.
        public let state: String?

        public init(alias: String? = nil, arn: String? = nil, completedDate: Date? = nil, defaultMailDomain: String? = nil, directoryId: String? = nil, directoryType: String? = nil, errorMessage: String? = nil, organizationId: String? = nil, state: String? = nil) {
            self.alias = alias
            self.arn = arn
            self.completedDate = completedDate
            self.defaultMailDomain = defaultMailDomain
            self.directoryId = directoryId
            self.directoryType = directoryType
            self.errorMessage = errorMessage
            self.organizationId = organizationId
            self.state = state
        }

        private enum CodingKeys: String, CodingKey {
            case alias = "Alias"
            case arn = "ARN"
            case completedDate = "CompletedDate"
            case defaultMailDomain = "DefaultMailDomain"
            case directoryId = "DirectoryId"
            case directoryType = "DirectoryType"
            case errorMessage = "ErrorMessage"
            case organizationId = "OrganizationId"
            case state = "State"
        }
    }

    public struct DescribeResourceRequest: AWSEncodableShape {
        /// The identifier associated with the organization for which the resource is described.
        public let organizationId: String
        /// The identifier of the resource to be described.
        public let resourceId: String

        public init(organizationId: String, resourceId: String) {
            self.organizationId = organizationId
            self.resourceId = resourceId
        }

        public func validate(name: String) throws {
            try self.validate(self.organizationId, name: "organizationId", parent: name, max: 34)
            try self.validate(self.organizationId, name: "organizationId", parent: name, min: 34)
            try self.validate(self.organizationId, name: "organizationId", parent: name, pattern: "^m-[0-9a-f]{32}$")
            try self.validate(self.resourceId, name: "resourceId", parent: name, max: 34)
            try self.validate(self.resourceId, name: "resourceId", parent: name, min: 34)
            try self.validate(self.resourceId, name: "resourceId", parent: name, pattern: "^r-[0-9a-f]{32}$")
        }

        private enum CodingKeys: String, CodingKey {
            case organizationId = "OrganizationId"
            case resourceId = "ResourceId"
        }
    }

    public struct DescribeResourceResponse: AWSDecodableShape {
        /// The booking options for the described resource.
        public let bookingOptions: BookingOptions?
        /// The date and time when a resource was disabled from WorkMail, in UNIX epoch time format.
        public let disabledDate: Date?
        /// The email of the described resource.
        public let email: String?
        /// The date and time when a resource was enabled for WorkMail, in UNIX epoch time format.
        public let enabledDate: Date?
        /// The name of the described resource.
        public let name: String?
        /// The identifier of the described resource.
        public let resourceId: String?
        /// The state of the resource: enabled (registered to Amazon WorkMail), disabled (deregistered or never registered to WorkMail), or deleted.
        public let state: EntityState?
        /// The type of the described resource.
        public let type: ResourceType?

        public init(bookingOptions: BookingOptions? = nil, disabledDate: Date? = nil, email: String? = nil, enabledDate: Date? = nil, name: String? = nil, resourceId: String? = nil, state: EntityState? = nil, type: ResourceType? = nil) {
            self.bookingOptions = bookingOptions
            self.disabledDate = disabledDate
            self.email = email
            self.enabledDate = enabledDate
            self.name = name
            self.resourceId = resourceId
            self.state = state
            self.type = type
        }

        private enum CodingKeys: String, CodingKey {
            case bookingOptions = "BookingOptions"
            case disabledDate = "DisabledDate"
            case email = "Email"
            case enabledDate = "EnabledDate"
            case name = "Name"
            case resourceId = "ResourceId"
            case state = "State"
            case type = "Type"
        }
    }

    public struct DescribeUserRequest: AWSEncodableShape {
        /// The identifier for the organization under which the user exists.
        public let organizationId: String
        /// The identifier for the user to be described.
        public let userId: String

        public init(organizationId: String, userId: String) {
            self.organizationId = organizationId
            self.userId = userId
        }

        public func validate(name: String) throws {
            try self.validate(self.organizationId, name: "organizationId", parent: name, max: 34)
            try self.validate(self.organizationId, name: "organizationId", parent: name, min: 34)
            try self.validate(self.organizationId, name: "organizationId", parent: name, pattern: "^m-[0-9a-f]{32}$")
            try self.validate(self.userId, name: "userId", parent: name, max: 256)
            try self.validate(self.userId, name: "userId", parent: name, min: 12)
        }

        private enum CodingKeys: String, CodingKey {
            case organizationId = "OrganizationId"
            case userId = "UserId"
        }
    }

    public struct DescribeUserResponse: AWSDecodableShape {
        /// The date and time at which the user was disabled for Amazon WorkMail usage, in UNIX epoch time format.
        public let disabledDate: Date?
        /// The display name of the user.
        public let displayName: String?
        /// The email of the user.
        public let email: String?
        /// The date and time at which the user was enabled for Amazon WorkMail usage, in UNIX epoch time format.
        public let enabledDate: Date?
        /// The name for the user.
        public let name: String?
        /// The state of a user: enabled (registered to Amazon WorkMail) or disabled (deregistered or never registered to WorkMail).
        public let state: EntityState?
        /// The identifier for the described user.
        public let userId: String?
        /// In certain cases, other entities are modeled as users. If interoperability is enabled, resources are imported into Amazon WorkMail as users. Because different WorkMail organizations rely on different directory types, administrators can distinguish between an unregistered user (account is disabled and has a user role) and the directory administrators. The values are USER, RESOURCE, and SYSTEM_USER.
        public let userRole: UserRole?

        public init(disabledDate: Date? = nil, displayName: String? = nil, email: String? = nil, enabledDate: Date? = nil, name: String? = nil, state: EntityState? = nil, userId: String? = nil, userRole: UserRole? = nil) {
            self.disabledDate = disabledDate
            self.displayName = displayName
            self.email = email
            self.enabledDate = enabledDate
            self.name = name
            self.state = state
            self.userId = userId
            self.userRole = userRole
        }

        private enum CodingKeys: String, CodingKey {
            case disabledDate = "DisabledDate"
            case displayName = "DisplayName"
            case email = "Email"
            case enabledDate = "EnabledDate"
            case name = "Name"
            case state = "State"
            case userId = "UserId"
            case userRole = "UserRole"
        }
    }

    public struct DisassociateDelegateFromResourceRequest: AWSEncodableShape {
        /// The identifier for the member (user, group) to be removed from the resource's delegates.
        public let entityId: String
        /// The identifier for the organization under which the resource exists.
        public let organizationId: String
        /// The identifier of the resource from which delegates' set members are removed.
        public let resourceId: String

        public init(entityId: String, organizationId: String, resourceId: String) {
            self.entityId = entityId
            self.organizationId = organizationId
            self.resourceId = resourceId
        }

        public func validate(name: String) throws {
            try self.validate(self.entityId, name: "entityId", parent: name, max: 256)
            try self.validate(self.entityId, name: "entityId", parent: name, min: 12)
            try self.validate(self.organizationId, name: "organizationId", parent: name, max: 34)
            try self.validate(self.organizationId, name: "organizationId", parent: name, min: 34)
            try self.validate(self.organizationId, name: "organizationId", parent: name, pattern: "^m-[0-9a-f]{32}$")
            try self.validate(self.resourceId, name: "resourceId", parent: name, max: 34)
            try self.validate(self.resourceId, name: "resourceId", parent: name, min: 34)
            try self.validate(self.resourceId, name: "resourceId", parent: name, pattern: "^r-[0-9a-f]{32}$")
        }

        private enum CodingKeys: String, CodingKey {
            case entityId = "EntityId"
            case organizationId = "OrganizationId"
            case resourceId = "ResourceId"
        }
    }

    public struct DisassociateDelegateFromResourceResponse: AWSDecodableShape {
        public init() {}
    }

    public struct DisassociateMemberFromGroupRequest: AWSEncodableShape {
        /// The identifier for the group from which members are removed.
        public let groupId: String
        /// The identifier for the member to be removed to the group.
        public let memberId: String
        /// The identifier for the organization under which the group exists.
        public let organizationId: String

        public init(groupId: String, memberId: String, organizationId: String) {
            self.groupId = groupId
            self.memberId = memberId
            self.organizationId = organizationId
        }

        public func validate(name: String) throws {
            try self.validate(self.groupId, name: "groupId", parent: name, max: 256)
            try self.validate(self.groupId, name: "groupId", parent: name, min: 12)
            try self.validate(self.memberId, name: "memberId", parent: name, max: 256)
            try self.validate(self.memberId, name: "memberId", parent: name, min: 12)
            try self.validate(self.organizationId, name: "organizationId", parent: name, max: 34)
            try self.validate(self.organizationId, name: "organizationId", parent: name, min: 34)
            try self.validate(self.organizationId, name: "organizationId", parent: name, pattern: "^m-[0-9a-f]{32}$")
        }

        private enum CodingKeys: String, CodingKey {
            case groupId = "GroupId"
            case memberId = "MemberId"
            case organizationId = "OrganizationId"
        }
    }

    public struct DisassociateMemberFromGroupResponse: AWSDecodableShape {
        public init() {}
    }

    public struct Domain: AWSEncodableShape {
        /// The fully qualified domain name.
        public let domainName: String?
        /// The hosted zone ID for a domain hosted in Route 53. Required when configuring a domain hosted in Route 53.
        public let hostedZoneId: String?

        public init(domainName: String? = nil, hostedZoneId: String? = nil) {
            self.domainName = domainName
            self.hostedZoneId = hostedZoneId
        }

        public func validate(name: String) throws {
            try self.validate(self.domainName, name: "domainName", parent: name, max: 255)
            try self.validate(self.domainName, name: "domainName", parent: name, min: 3)
            try self.validate(self.domainName, name: "domainName", parent: name, pattern: "[a-zA-Z0-9.-]+\\.[a-zA-Z-]{2,}")
            try self.validate(self.hostedZoneId, name: "hostedZoneId", parent: name, max: 32)
            try self.validate(self.hostedZoneId, name: "hostedZoneId", parent: name, min: 1)
            try self.validate(self.hostedZoneId, name: "hostedZoneId", parent: name, pattern: "[\\S\\s]*")
        }

        private enum CodingKeys: String, CodingKey {
            case domainName = "DomainName"
            case hostedZoneId = "HostedZoneId"
        }
    }

    public struct FolderConfiguration: AWSEncodableShape & AWSDecodableShape {
        /// The action to take on the folder contents at the end of the folder configuration period.
        public let action: RetentionAction
        /// The folder name.
        public let name: FolderName
        /// The period of time at which the folder configuration action is applied.
        public let period: Int?

        public init(action: RetentionAction, name: FolderName, period: Int? = nil) {
            self.action = action
            self.name = name
            self.period = period
        }

        public func validate(name: String) throws {
            try self.validate(self.period, name: "period", parent: name, max: 730)
            try self.validate(self.period, name: "period", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case action = "Action"
            case name = "Name"
            case period = "Period"
        }
    }

    public struct GetAccessControlEffectRequest: AWSEncodableShape {
        /// The access protocol action. Valid values include ActiveSync, AutoDiscover, EWS, IMAP, SMTP, WindowsOutlook, and WebMail.
        public let action: String
        /// The IPv4 address.
        public let ipAddress: String
        /// The identifier for the organization.
        public let organizationId: String
        /// The user ID.
        public let userId: String

        public init(action: String, ipAddress: String, organizationId: String, userId: String) {
            self.action = action
            self.ipAddress = ipAddress
            self.organizationId = organizationId
            self.userId = userId
        }

        public func validate(name: String) throws {
            try self.validate(self.action, name: "action", parent: name, max: 64)
            try self.validate(self.action, name: "action", parent: name, min: 1)
            try self.validate(self.action, name: "action", parent: name, pattern: "[a-zA-Z]+")
            try self.validate(self.ipAddress, name: "ipAddress", parent: name, max: 15)
            try self.validate(self.ipAddress, name: "ipAddress", parent: name, min: 1)
            try self.validate(self.ipAddress, name: "ipAddress", parent: name, pattern: "^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$")
            try self.validate(self.organizationId, name: "organizationId", parent: name, max: 34)
            try self.validate(self.organizationId, name: "organizationId", parent: name, min: 34)
            try self.validate(self.organizationId, name: "organizationId", parent: name, pattern: "^m-[0-9a-f]{32}$")
            try self.validate(self.userId, name: "userId", parent: name, max: 256)
            try self.validate(self.userId, name: "userId", parent: name, min: 12)
        }

        private enum CodingKeys: String, CodingKey {
            case action = "Action"
            case ipAddress = "IpAddress"
            case organizationId = "OrganizationId"
            case userId = "UserId"
        }
    }

    public struct GetAccessControlEffectResponse: AWSDecodableShape {
        /// The rule effect.
        public let effect: AccessControlRuleEffect?
        /// The rules that match the given parameters, resulting in an effect.
        public let matchedRules: [String]?

        public init(effect: AccessControlRuleEffect? = nil, matchedRules: [String]? = nil) {
            self.effect = effect
            self.matchedRules = matchedRules
        }

        private enum CodingKeys: String, CodingKey {
            case effect = "Effect"
            case matchedRules = "MatchedRules"
        }
    }

    public struct GetDefaultRetentionPolicyRequest: AWSEncodableShape {
        /// The organization ID.
        public let organizationId: String

        public init(organizationId: String) {
            self.organizationId = organizationId
        }

        public func validate(name: String) throws {
            try self.validate(self.organizationId, name: "organizationId", parent: name, max: 34)
            try self.validate(self.organizationId, name: "organizationId", parent: name, min: 34)
            try self.validate(self.organizationId, name: "organizationId", parent: name, pattern: "^m-[0-9a-f]{32}$")
        }

        private enum CodingKeys: String, CodingKey {
            case organizationId = "OrganizationId"
        }
    }

    public struct GetDefaultRetentionPolicyResponse: AWSDecodableShape {
        /// The retention policy description.
        public let description: String?
        /// The retention policy folder configurations.
        public let folderConfigurations: [FolderConfiguration]?
        /// The retention policy ID.
        public let id: String?
        /// The retention policy name.
        public let name: String?

        public init(description: String? = nil, folderConfigurations: [FolderConfiguration]? = nil, id: String? = nil, name: String? = nil) {
            self.description = description
            self.folderConfigurations = folderConfigurations
            self.id = id
            self.name = name
        }

        private enum CodingKeys: String, CodingKey {
            case description = "Description"
            case folderConfigurations = "FolderConfigurations"
            case id = "Id"
            case name = "Name"
        }
    }

    public struct GetMailboxDetailsRequest: AWSEncodableShape {
        /// The identifier for the organization that contains the user whose mailbox details are being requested.
        public let organizationId: String
        /// The identifier for the user whose mailbox details are being requested.
        public let userId: String

        public init(organizationId: String, userId: String) {
            self.organizationId = organizationId
            self.userId = userId
        }

        public func validate(name: String) throws {
            try self.validate(self.organizationId, name: "organizationId", parent: name, max: 34)
            try self.validate(self.organizationId, name: "organizationId", parent: name, min: 34)
            try self.validate(self.organizationId, name: "organizationId", parent: name, pattern: "^m-[0-9a-f]{32}$")
            try self.validate(self.userId, name: "userId", parent: name, max: 256)
            try self.validate(self.userId, name: "userId", parent: name, min: 12)
        }

        private enum CodingKeys: String, CodingKey {
            case organizationId = "OrganizationId"
            case userId = "UserId"
        }
    }

    public struct GetMailboxDetailsResponse: AWSDecodableShape {
        /// The maximum allowed mailbox size, in MB, for the specified user.
        public let mailboxQuota: Int?
        /// The current mailbox size, in MB, for the specified user.
        public let mailboxSize: Double?

        public init(mailboxQuota: Int? = nil, mailboxSize: Double? = nil) {
            self.mailboxQuota = mailboxQuota
            self.mailboxSize = mailboxSize
        }

        private enum CodingKeys: String, CodingKey {
            case mailboxQuota = "MailboxQuota"
            case mailboxSize = "MailboxSize"
        }
    }

    public struct Group: AWSDecodableShape {
        /// The date indicating when the group was disabled from Amazon WorkMail use.
        public let disabledDate: Date?
        /// The email of the group.
        public let email: String?
        /// The date indicating when the group was enabled for Amazon WorkMail use.
        public let enabledDate: Date?
        /// The identifier of the group.
        public let id: String?
        /// The name of the group.
        public let name: String?
        /// The state of the group, which can be ENABLED, DISABLED, or DELETED.
        public let state: EntityState?

        public init(disabledDate: Date? = nil, email: String? = nil, enabledDate: Date? = nil, id: String? = nil, name: String? = nil, state: EntityState? = nil) {
            self.disabledDate = disabledDate
            self.email = email
            self.enabledDate = enabledDate
            self.id = id
            self.name = name
            self.state = state
        }

        private enum CodingKeys: String, CodingKey {
            case disabledDate = "DisabledDate"
            case email = "Email"
            case enabledDate = "EnabledDate"
            case id = "Id"
            case name = "Name"
            case state = "State"
        }
    }

    public struct ListAccessControlRulesRequest: AWSEncodableShape {
        /// The identifier for the organization.
        public let organizationId: String

        public init(organizationId: String) {
            self.organizationId = organizationId
        }

        public func validate(name: String) throws {
            try self.validate(self.organizationId, name: "organizationId", parent: name, max: 34)
            try self.validate(self.organizationId, name: "organizationId", parent: name, min: 34)
            try self.validate(self.organizationId, name: "organizationId", parent: name, pattern: "^m-[0-9a-f]{32}$")
        }

        private enum CodingKeys: String, CodingKey {
            case organizationId = "OrganizationId"
        }
    }

    public struct ListAccessControlRulesResponse: AWSDecodableShape {
        /// The access control rules.
        public let rules: [AccessControlRule]?

        public init(rules: [AccessControlRule]? = nil) {
            self.rules = rules
        }

        private enum CodingKeys: String, CodingKey {
            case rules = "Rules"
        }
    }

    public struct ListAliasesRequest: AWSEncodableShape {
        /// The identifier for the entity for which to list the aliases.
        public let entityId: String
        /// The maximum number of results to return in a single call.
        public let maxResults: Int?
        /// The token to use to retrieve the next page of results. The first call does not contain any tokens.
        public let nextToken: String?
        /// The identifier for the organization under which the entity exists.
        public let organizationId: String

        public init(entityId: String, maxResults: Int? = nil, nextToken: String? = nil, organizationId: String) {
            self.entityId = entityId
            self.maxResults = maxResults
            self.nextToken = nextToken
            self.organizationId = organizationId
        }

        public func validate(name: String) throws {
            try self.validate(self.entityId, name: "entityId", parent: name, max: 256)
            try self.validate(self.entityId, name: "entityId", parent: name, min: 12)
            try self.validate(self.maxResults, name: "maxResults", parent: name, max: 100)
            try self.validate(self.maxResults, name: "maxResults", parent: name, min: 1)
            try self.validate(self.nextToken, name: "nextToken", parent: name, max: 1024)
            try self.validate(self.nextToken, name: "nextToken", parent: name, min: 1)
            try self.validate(self.nextToken, name: "nextToken", parent: name, pattern: "[\\S\\s]*|[a-zA-Z0-9/+=]{1,1024}")
            try self.validate(self.organizationId, name: "organizationId", parent: name, max: 34)
            try self.validate(self.organizationId, name: "organizationId", parent: name, min: 34)
            try self.validate(self.organizationId, name: "organizationId", parent: name, pattern: "^m-[0-9a-f]{32}$")
        }

        private enum CodingKeys: String, CodingKey {
            case entityId = "EntityId"
            case maxResults = "MaxResults"
            case nextToken = "NextToken"
            case organizationId = "OrganizationId"
        }
    }

    public struct ListAliasesResponse: AWSDecodableShape {
        /// The entity's paginated aliases.
        public let aliases: [String]?
        /// The token to use to retrieve the next page of results. The value is "null" when there are no more results to return.
        public let nextToken: String?

        public init(aliases: [String]? = nil, nextToken: String? = nil) {
            self.aliases = aliases
            self.nextToken = nextToken
        }

        private enum CodingKeys: String, CodingKey {
            case aliases = "Aliases"
            case nextToken = "NextToken"
        }
    }

    public struct ListGroupMembersRequest: AWSEncodableShape {
        /// The identifier for the group to which the members (users or groups) are associated.
        public let groupId: String
        /// The maximum number of results to return in a single call.
        public let maxResults: Int?
        ///  The token to use to retrieve the next page of results. The first call does not contain any tokens.
        public let nextToken: String?
        /// The identifier for the organization under which the group exists.
        public let organizationId: String

        public init(groupId: String, maxResults: Int? = nil, nextToken: String? = nil, organizationId: String) {
            self.groupId = groupId
            self.maxResults = maxResults
            self.nextToken = nextToken
            self.organizationId = organizationId
        }

        public func validate(name: String) throws {
            try self.validate(self.groupId, name: "groupId", parent: name, max: 256)
            try self.validate(self.groupId, name: "groupId", parent: name, min: 12)
            try self.validate(self.maxResults, name: "maxResults", parent: name, max: 100)
            try self.validate(self.maxResults, name: "maxResults", parent: name, min: 1)
            try self.validate(self.nextToken, name: "nextToken", parent: name, max: 1024)
            try self.validate(self.nextToken, name: "nextToken", parent: name, min: 1)
            try self.validate(self.nextToken, name: "nextToken", parent: name, pattern: "[\\S\\s]*|[a-zA-Z0-9/+=]{1,1024}")
            try self.validate(self.organizationId, name: "organizationId", parent: name, max: 34)
            try self.validate(self.organizationId, name: "organizationId", parent: name, min: 34)
            try self.validate(self.organizationId, name: "organizationId", parent: name, pattern: "^m-[0-9a-f]{32}$")
        }

        private enum CodingKeys: String, CodingKey {
            case groupId = "GroupId"
            case maxResults = "MaxResults"
            case nextToken = "NextToken"
            case organizationId = "OrganizationId"
        }
    }

    public struct ListGroupMembersResponse: AWSDecodableShape {
        /// The members associated to the group.
        public let members: [Member]?
        /// The token to use to retrieve the next page of results. The first call does not contain any tokens.
        public let nextToken: String?

        public init(members: [Member]? = nil, nextToken: String? = nil) {
            self.members = members
            self.nextToken = nextToken
        }

        private enum CodingKeys: String, CodingKey {
            case members = "Members"
            case nextToken = "NextToken"
        }
    }

    public struct ListGroupsRequest: AWSEncodableShape {
        /// The maximum number of results to return in a single call.
        public let maxResults: Int?
        /// The token to use to retrieve the next page of results. The first call does not contain any tokens.
        public let nextToken: String?
        /// The identifier for the organization under which the groups exist.
        public let organizationId: String

        public init(maxResults: Int? = nil, nextToken: String? = nil, organizationId: String) {
            self.maxResults = maxResults
            self.nextToken = nextToken
            self.organizationId = organizationId
        }

        public func validate(name: String) throws {
            try self.validate(self.maxResults, name: "maxResults", parent: name, max: 100)
            try self.validate(self.maxResults, name: "maxResults", parent: name, min: 1)
            try self.validate(self.nextToken, name: "nextToken", parent: name, max: 1024)
            try self.validate(self.nextToken, name: "nextToken", parent: name, min: 1)
            try self.validate(self.nextToken, name: "nextToken", parent: name, pattern: "[\\S\\s]*|[a-zA-Z0-9/+=]{1,1024}")
            try self.validate(self.organizationId, name: "organizationId", parent: name, max: 34)
            try self.validate(self.organizationId, name: "organizationId", parent: name, min: 34)
            try self.validate(self.organizationId, name: "organizationId", parent: name, pattern: "^m-[0-9a-f]{32}$")
        }

        private enum CodingKeys: String, CodingKey {
            case maxResults = "MaxResults"
            case nextToken = "NextToken"
            case organizationId = "OrganizationId"
        }
    }

    public struct ListGroupsResponse: AWSDecodableShape {
        /// The overview of groups for an organization.
        public let groups: [Group]?
        /// The token to use to retrieve the next page of results. The value is "null" when there are no more results to return.
        public let nextToken: String?

        public init(groups: [Group]? = nil, nextToken: String? = nil) {
            self.groups = groups
            self.nextToken = nextToken
        }

        private enum CodingKeys: String, CodingKey {
            case groups = "Groups"
            case nextToken = "NextToken"
        }
    }

    public struct ListMailboxExportJobsRequest: AWSEncodableShape {
        /// The maximum number of results to return in a single call.
        public let maxResults: Int?
        /// The token to use to retrieve the next page of results.
        public let nextToken: String?
        /// The organization ID.
        public let organizationId: String

        public init(maxResults: Int? = nil, nextToken: String? = nil, organizationId: String) {
            self.maxResults = maxResults
            self.nextToken = nextToken
            self.organizationId = organizationId
        }

        public func validate(name: String) throws {
            try self.validate(self.maxResults, name: "maxResults", parent: name, max: 100)
            try self.validate(self.maxResults, name: "maxResults", parent: name, min: 1)
            try self.validate(self.nextToken, name: "nextToken", parent: name, max: 1024)
            try self.validate(self.nextToken, name: "nextToken", parent: name, min: 1)
            try self.validate(self.nextToken, name: "nextToken", parent: name, pattern: "[\\S\\s]*|[a-zA-Z0-9/+=]{1,1024}")
            try self.validate(self.organizationId, name: "organizationId", parent: name, max: 34)
            try self.validate(self.organizationId, name: "organizationId", parent: name, min: 34)
            try self.validate(self.organizationId, name: "organizationId", parent: name, pattern: "^m-[0-9a-f]{32}$")
        }

        private enum CodingKeys: String, CodingKey {
            case maxResults = "MaxResults"
            case nextToken = "NextToken"
            case organizationId = "OrganizationId"
        }
    }

    public struct ListMailboxExportJobsResponse: AWSDecodableShape {
        /// The mailbox export job details.
        public let jobs: [MailboxExportJob]?
        /// The token to use to retrieve the next page of results.
        public let nextToken: String?

        public init(jobs: [MailboxExportJob]? = nil, nextToken: String? = nil) {
            self.jobs = jobs
            self.nextToken = nextToken
        }

        private enum CodingKeys: String, CodingKey {
            case jobs = "Jobs"
            case nextToken = "NextToken"
        }
    }

    public struct ListMailboxPermissionsRequest: AWSEncodableShape {
        /// The identifier of the user, group, or resource for which to list mailbox permissions.
        public let entityId: String
        /// The maximum number of results to return in a single call.
        public let maxResults: Int?
        /// The token to use to retrieve the next page of results. The first call does not contain any tokens.
        public let nextToken: String?
        /// The identifier of the organization under which the user, group, or resource exists.
        public let organizationId: String

        public init(entityId: String, maxResults: Int? = nil, nextToken: String? = nil, organizationId: String) {
            self.entityId = entityId
            self.maxResults = maxResults
            self.nextToken = nextToken
            self.organizationId = organizationId
        }

        public func validate(name: String) throws {
            try self.validate(self.entityId, name: "entityId", parent: name, max: 256)
            try self.validate(self.entityId, name: "entityId", parent: name, min: 12)
            try self.validate(self.maxResults, name: "maxResults", parent: name, max: 100)
            try self.validate(self.maxResults, name: "maxResults", parent: name, min: 1)
            try self.validate(self.nextToken, name: "nextToken", parent: name, max: 1024)
            try self.validate(self.nextToken, name: "nextToken", parent: name, min: 1)
            try self.validate(self.nextToken, name: "nextToken", parent: name, pattern: "[\\S\\s]*|[a-zA-Z0-9/+=]{1,1024}")
            try self.validate(self.organizationId, name: "organizationId", parent: name, max: 34)
            try self.validate(self.organizationId, name: "organizationId", parent: name, min: 34)
            try self.validate(self.organizationId, name: "organizationId", parent: name, pattern: "^m-[0-9a-f]{32}$")
        }

        private enum CodingKeys: String, CodingKey {
            case entityId = "EntityId"
            case maxResults = "MaxResults"
            case nextToken = "NextToken"
            case organizationId = "OrganizationId"
        }
    }

    public struct ListMailboxPermissionsResponse: AWSDecodableShape {
        /// The token to use to retrieve the next page of results. The value is "null" when there are no more results to return.
        public let nextToken: String?
        /// One page of the user, group, or resource mailbox permissions.
        public let permissions: [Permission]?

        public init(nextToken: String? = nil, permissions: [Permission]? = nil) {
            self.nextToken = nextToken
            self.permissions = permissions
        }

        private enum CodingKeys: String, CodingKey {
            case nextToken = "NextToken"
            case permissions = "Permissions"
        }
    }

    public struct ListOrganizationsRequest: AWSEncodableShape {
        /// The maximum number of results to return in a single call.
        public let maxResults: Int?
        /// The token to use to retrieve the next page of results. The first call does not contain any tokens.
        public let nextToken: String?

        public init(maxResults: Int? = nil, nextToken: String? = nil) {
            self.maxResults = maxResults
            self.nextToken = nextToken
        }

        public func validate(name: String) throws {
            try self.validate(self.maxResults, name: "maxResults", parent: name, max: 100)
            try self.validate(self.maxResults, name: "maxResults", parent: name, min: 1)
            try self.validate(self.nextToken, name: "nextToken", parent: name, max: 1024)
            try self.validate(self.nextToken, name: "nextToken", parent: name, min: 1)
            try self.validate(self.nextToken, name: "nextToken", parent: name, pattern: "[\\S\\s]*|[a-zA-Z0-9/+=]{1,1024}")
        }

        private enum CodingKeys: String, CodingKey {
            case maxResults = "MaxResults"
            case nextToken = "NextToken"
        }
    }

    public struct ListOrganizationsResponse: AWSDecodableShape {
        /// The token to use to retrieve the next page of results. The value is "null" when there are no more results to return.
        public let nextToken: String?
        /// The overview of owned organizations presented as a list of organization summaries.
        public let organizationSummaries: [OrganizationSummary]?

        public init(nextToken: String? = nil, organizationSummaries: [OrganizationSummary]? = nil) {
            self.nextToken = nextToken
            self.organizationSummaries = organizationSummaries
        }

        private enum CodingKeys: String, CodingKey {
            case nextToken = "NextToken"
            case organizationSummaries = "OrganizationSummaries"
        }
    }

    public struct ListResourceDelegatesRequest: AWSEncodableShape {
        /// The number of maximum results in a page.
        public let maxResults: Int?
        /// The token used to paginate through the delegates associated with a resource.
        public let nextToken: String?
        /// The identifier for the organization that contains the resource for which delegates are listed.
        public let organizationId: String
        /// The identifier for the resource whose delegates are listed.
        public let resourceId: String

        public init(maxResults: Int? = nil, nextToken: String? = nil, organizationId: String, resourceId: String) {
            self.maxResults = maxResults
            self.nextToken = nextToken
            self.organizationId = organizationId
            self.resourceId = resourceId
        }

        public func validate(name: String) throws {
            try self.validate(self.maxResults, name: "maxResults", parent: name, max: 100)
            try self.validate(self.maxResults, name: "maxResults", parent: name, min: 1)
            try self.validate(self.nextToken, name: "nextToken", parent: name, max: 1024)
            try self.validate(self.nextToken, name: "nextToken", parent: name, min: 1)
            try self.validate(self.nextToken, name: "nextToken", parent: name, pattern: "[\\S\\s]*|[a-zA-Z0-9/+=]{1,1024}")
            try self.validate(self.organizationId, name: "organizationId", parent: name, max: 34)
            try self.validate(self.organizationId, name: "organizationId", parent: name, min: 34)
            try self.validate(self.organizationId, name: "organizationId", parent: name, pattern: "^m-[0-9a-f]{32}$")
            try self.validate(self.resourceId, name: "resourceId", parent: name, max: 256)
            try self.validate(self.resourceId, name: "resourceId", parent: name, min: 12)
        }

        private enum CodingKeys: String, CodingKey {
            case maxResults = "MaxResults"
            case nextToken = "NextToken"
            case organizationId = "OrganizationId"
            case resourceId = "ResourceId"
        }
    }

    public struct ListResourceDelegatesResponse: AWSDecodableShape {
        /// One page of the resource's delegates.
        public let delegates: [Delegate]?
        /// The token used to paginate through the delegates associated with a resource. While results are still available, it has an associated value. When the last page is reached, the token is empty.
        public let nextToken: String?

        public init(delegates: [Delegate]? = nil, nextToken: String? = nil) {
            self.delegates = delegates
            self.nextToken = nextToken
        }

        private enum CodingKeys: String, CodingKey {
            case delegates = "Delegates"
            case nextToken = "NextToken"
        }
    }

    public struct ListResourcesRequest: AWSEncodableShape {
        /// The maximum number of results to return in a single call.
        public let maxResults: Int?
        /// The token to use to retrieve the next page of results. The first call does not contain any tokens.
        public let nextToken: String?
        /// The identifier for the organization under which the resources exist.
        public let organizationId: String

        public init(maxResults: Int? = nil, nextToken: String? = nil, organizationId: String) {
            self.maxResults = maxResults
            self.nextToken = nextToken
            self.organizationId = organizationId
        }

        public func validate(name: String) throws {
            try self.validate(self.maxResults, name: "maxResults", parent: name, max: 100)
            try self.validate(self.maxResults, name: "maxResults", parent: name, min: 1)
            try self.validate(self.nextToken, name: "nextToken", parent: name, max: 1024)
            try self.validate(self.nextToken, name: "nextToken", parent: name, min: 1)
            try self.validate(self.nextToken, name: "nextToken", parent: name, pattern: "[\\S\\s]*|[a-zA-Z0-9/+=]{1,1024}")
            try self.validate(self.organizationId, name: "organizationId", parent: name, max: 34)
            try self.validate(self.organizationId, name: "organizationId", parent: name, min: 34)
            try self.validate(self.organizationId, name: "organizationId", parent: name, pattern: "^m-[0-9a-f]{32}$")
        }

        private enum CodingKeys: String, CodingKey {
            case maxResults = "MaxResults"
            case nextToken = "NextToken"
            case organizationId = "OrganizationId"
        }
    }

    public struct ListResourcesResponse: AWSDecodableShape {
        ///  The token used to paginate through all the organization's resources. While results are still available, it has an associated value. When the last page is reached, the token is empty.
        public let nextToken: String?
        /// One page of the organization's resource representation.
        public let resources: [Resource]?

        public init(nextToken: String? = nil, resources: [Resource]? = nil) {
            self.nextToken = nextToken
            self.resources = resources
        }

        private enum CodingKeys: String, CodingKey {
            case nextToken = "NextToken"
            case resources = "Resources"
        }
    }

    public struct ListTagsForResourceRequest: AWSEncodableShape {
        /// The resource ARN.
        public let resourceARN: String

        public init(resourceARN: String) {
            self.resourceARN = resourceARN
        }

        public func validate(name: String) throws {
            try self.validate(self.resourceARN, name: "resourceARN", parent: name, max: 1011)
            try self.validate(self.resourceARN, name: "resourceARN", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case resourceARN = "ResourceARN"
        }
    }

    public struct ListTagsForResourceResponse: AWSDecodableShape {
        /// A list of tag key-value pairs.
        public let tags: [Tag]?

        public init(tags: [Tag]? = nil) {
            self.tags = tags
        }

        private enum CodingKeys: String, CodingKey {
            case tags = "Tags"
        }
    }

    public struct ListUsersRequest: AWSEncodableShape {
        /// The maximum number of results to return in a single call.
        public let maxResults: Int?
        /// The token to use to retrieve the next page of results. The first call does not contain any tokens.
        public let nextToken: String?
        /// The identifier for the organization under which the users exist.
        public let organizationId: String

        public init(maxResults: Int? = nil, nextToken: String? = nil, organizationId: String) {
            self.maxResults = maxResults
            self.nextToken = nextToken
            self.organizationId = organizationId
        }

        public func validate(name: String) throws {
            try self.validate(self.maxResults, name: "maxResults", parent: name, max: 100)
            try self.validate(self.maxResults, name: "maxResults", parent: name, min: 1)
            try self.validate(self.nextToken, name: "nextToken", parent: name, max: 1024)
            try self.validate(self.nextToken, name: "nextToken", parent: name, min: 1)
            try self.validate(self.nextToken, name: "nextToken", parent: name, pattern: "[\\S\\s]*|[a-zA-Z0-9/+=]{1,1024}")
            try self.validate(self.organizationId, name: "organizationId", parent: name, max: 34)
            try self.validate(self.organizationId, name: "organizationId", parent: name, min: 34)
            try self.validate(self.organizationId, name: "organizationId", parent: name, pattern: "^m-[0-9a-f]{32}$")
        }

        private enum CodingKeys: String, CodingKey {
            case maxResults = "MaxResults"
            case nextToken = "NextToken"
            case organizationId = "OrganizationId"
        }
    }

    public struct ListUsersResponse: AWSDecodableShape {
        ///  The token to use to retrieve the next page of results. This value is `null` when there are no more results to return.
        public let nextToken: String?
        /// The overview of users for an organization.
        public let users: [User]?

        public init(nextToken: String? = nil, users: [User]? = nil) {
            self.nextToken = nextToken
            self.users = users
        }

        private enum CodingKeys: String, CodingKey {
            case nextToken = "NextToken"
            case users = "Users"
        }
    }

    public struct MailboxExportJob: AWSDecodableShape {
        /// The mailbox export job description.
        public let description: String?
        /// The mailbox export job end timestamp.
        public let endTime: Date?
        /// The identifier of the user or resource associated with the mailbox.
        public let entityId: String?
        /// The estimated progress of the mailbox export job, in percentage points.
        public let estimatedProgress: Int?
        /// The identifier of the mailbox export job.
        public let jobId: String?
        /// The name of the S3 bucket.
        public let s3BucketName: String?
        /// The path to the S3 bucket and file that the mailbox export job exports to.
        public let s3Path: String?
        /// The mailbox export job start timestamp.
        public let startTime: Date?
        /// The state of the mailbox export job.
        public let state: MailboxExportJobState?

        public init(description: String? = nil, endTime: Date? = nil, entityId: String? = nil, estimatedProgress: Int? = nil, jobId: String? = nil, s3BucketName: String? = nil, s3Path: String? = nil, startTime: Date? = nil, state: MailboxExportJobState? = nil) {
            self.description = description
            self.endTime = endTime
            self.entityId = entityId
            self.estimatedProgress = estimatedProgress
            self.jobId = jobId
            self.s3BucketName = s3BucketName
            self.s3Path = s3Path
            self.startTime = startTime
            self.state = state
        }

        private enum CodingKeys: String, CodingKey {
            case description = "Description"
            case endTime = "EndTime"
            case entityId = "EntityId"
            case estimatedProgress = "EstimatedProgress"
            case jobId = "JobId"
            case s3BucketName = "S3BucketName"
            case s3Path = "S3Path"
            case startTime = "StartTime"
            case state = "State"
        }
    }

    public struct Member: AWSDecodableShape {
        /// The date indicating when the member was disabled from Amazon WorkMail use.
        public let disabledDate: Date?
        /// The date indicating when the member was enabled for Amazon WorkMail use.
        public let enabledDate: Date?
        /// The identifier of the member.
        public let id: String?
        /// The name of the member.
        public let name: String?
        /// The state of the member, which can be ENABLED, DISABLED, or DELETED.
        public let state: EntityState?
        /// A member can be a user or group.
        public let type: MemberType?

        public init(disabledDate: Date? = nil, enabledDate: Date? = nil, id: String? = nil, name: String? = nil, state: EntityState? = nil, type: MemberType? = nil) {
            self.disabledDate = disabledDate
            self.enabledDate = enabledDate
            self.id = id
            self.name = name
            self.state = state
            self.type = type
        }

        private enum CodingKeys: String, CodingKey {
            case disabledDate = "DisabledDate"
            case enabledDate = "EnabledDate"
            case id = "Id"
            case name = "Name"
            case state = "State"
            case type = "Type"
        }
    }

    public struct OrganizationSummary: AWSDecodableShape {
        /// The alias associated with the organization.
        public let alias: String?
        /// The default email domain associated with the organization.
        public let defaultMailDomain: String?
        /// The error message associated with the organization. It is only present if unexpected behavior has occurred with regards to the organization. It provides insight or solutions regarding unexpected behavior.
        public let errorMessage: String?
        /// The identifier associated with the organization.
        public let organizationId: String?
        /// The state associated with the organization.
        public let state: String?

        public init(alias: String? = nil, defaultMailDomain: String? = nil, errorMessage: String? = nil, organizationId: String? = nil, state: String? = nil) {
            self.alias = alias
            self.defaultMailDomain = defaultMailDomain
            self.errorMessage = errorMessage
            self.organizationId = organizationId
            self.state = state
        }

        private enum CodingKeys: String, CodingKey {
            case alias = "Alias"
            case defaultMailDomain = "DefaultMailDomain"
            case errorMessage = "ErrorMessage"
            case organizationId = "OrganizationId"
            case state = "State"
        }
    }

    public struct Permission: AWSDecodableShape {
        /// The identifier of the user, group, or resource to which the permissions are granted.
        public let granteeId: String
        /// The type of user, group, or resource referred to in GranteeId.
        public let granteeType: MemberType
        /// The permissions granted to the grantee. SEND_AS allows the grantee to send email as the owner of the mailbox (the grantee is not mentioned on these emails). SEND_ON_BEHALF allows the grantee to send email on behalf of the owner of the mailbox (the grantee is not mentioned as the physical sender of these emails). FULL_ACCESS allows the grantee full access to the mailbox, irrespective of other folder-level permissions set on the mailbox.
        public let permissionValues: [PermissionType]

        public init(granteeId: String, granteeType: MemberType, permissionValues: [PermissionType]) {
            self.granteeId = granteeId
            self.granteeType = granteeType
            self.permissionValues = permissionValues
        }

        private enum CodingKeys: String, CodingKey {
            case granteeId = "GranteeId"
            case granteeType = "GranteeType"
            case permissionValues = "PermissionValues"
        }
    }

    public struct PutAccessControlRuleRequest: AWSEncodableShape {
        /// Access protocol actions to include in the rule. Valid values include ActiveSync, AutoDiscover, EWS, IMAP, SMTP, WindowsOutlook, and WebMail.
        public let actions: [String]?
        /// The rule description.
        public let description: String
        /// The rule effect.
        public let effect: AccessControlRuleEffect
        /// IPv4 CIDR ranges to include in the rule.
        public let ipRanges: [String]?
        /// The rule name.
        public let name: String
        /// Access protocol actions to exclude from the rule. Valid values include ActiveSync, AutoDiscover, EWS, IMAP, SMTP, WindowsOutlook, and WebMail.
        public let notActions: [String]?
        /// IPv4 CIDR ranges to exclude from the rule.
        public let notIpRanges: [String]?
        /// User IDs to exclude from the rule.
        public let notUserIds: [String]?
        /// The identifier of the organization.
        public let organizationId: String
        /// User IDs to include in the rule.
        public let userIds: [String]?

        public init(actions: [String]? = nil, description: String, effect: AccessControlRuleEffect, ipRanges: [String]? = nil, name: String, notActions: [String]? = nil, notIpRanges: [String]? = nil, notUserIds: [String]? = nil, organizationId: String, userIds: [String]? = nil) {
            self.actions = actions
            self.description = description
            self.effect = effect
            self.ipRanges = ipRanges
            self.name = name
            self.notActions = notActions
            self.notIpRanges = notIpRanges
            self.notUserIds = notUserIds
            self.organizationId = organizationId
            self.userIds = userIds
        }

        public func validate(name: String) throws {
            try self.actions?.forEach {
                try validate($0, name: "actions[]", parent: name, max: 64)
                try validate($0, name: "actions[]", parent: name, min: 1)
                try validate($0, name: "actions[]", parent: name, pattern: "[a-zA-Z]+")
            }
            try self.validate(self.actions, name: "actions", parent: name, max: 10)
            try self.validate(self.actions, name: "actions", parent: name, min: 0)
            try self.validate(self.description, name: "description", parent: name, max: 255)
            try self.validate(self.description, name: "description", parent: name, min: 0)
            try self.validate(self.description, name: "description", parent: name, pattern: "[\\u0020-\\u00FF]+")
            try self.ipRanges?.forEach {
                try validate($0, name: "ipRanges[]", parent: name, max: 18)
                try validate($0, name: "ipRanges[]", parent: name, min: 1)
                try validate($0, name: "ipRanges[]", parent: name, pattern: "^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])/([0-9]|[12][0-9]|3[0-2])$")
            }
            try self.validate(self.ipRanges, name: "ipRanges", parent: name, max: 1024)
            try self.validate(self.ipRanges, name: "ipRanges", parent: name, min: 0)
            try self.validate(self.name, name: "name", parent: name, max: 64)
            try self.validate(self.name, name: "name", parent: name, min: 1)
            try self.validate(self.name, name: "name", parent: name, pattern: "[a-zA-Z0-9_-]+")
            try self.notActions?.forEach {
                try validate($0, name: "notActions[]", parent: name, max: 64)
                try validate($0, name: "notActions[]", parent: name, min: 1)
                try validate($0, name: "notActions[]", parent: name, pattern: "[a-zA-Z]+")
            }
            try self.validate(self.notActions, name: "notActions", parent: name, max: 10)
            try self.validate(self.notActions, name: "notActions", parent: name, min: 0)
            try self.notIpRanges?.forEach {
                try validate($0, name: "notIpRanges[]", parent: name, max: 18)
                try validate($0, name: "notIpRanges[]", parent: name, min: 1)
                try validate($0, name: "notIpRanges[]", parent: name, pattern: "^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])/([0-9]|[12][0-9]|3[0-2])$")
            }
            try self.validate(self.notIpRanges, name: "notIpRanges", parent: name, max: 1024)
            try self.validate(self.notIpRanges, name: "notIpRanges", parent: name, min: 0)
            try self.notUserIds?.forEach {
                try validate($0, name: "notUserIds[]", parent: name, max: 256)
                try validate($0, name: "notUserIds[]", parent: name, min: 12)
            }
            try self.validate(self.notUserIds, name: "notUserIds", parent: name, max: 10)
            try self.validate(self.notUserIds, name: "notUserIds", parent: name, min: 0)
            try self.validate(self.organizationId, name: "organizationId", parent: name, max: 34)
            try self.validate(self.organizationId, name: "organizationId", parent: name, min: 34)
            try self.validate(self.organizationId, name: "organizationId", parent: name, pattern: "^m-[0-9a-f]{32}$")
            try self.userIds?.forEach {
                try validate($0, name: "userIds[]", parent: name, max: 256)
                try validate($0, name: "userIds[]", parent: name, min: 12)
            }
            try self.validate(self.userIds, name: "userIds", parent: name, max: 10)
            try self.validate(self.userIds, name: "userIds", parent: name, min: 0)
        }

        private enum CodingKeys: String, CodingKey {
            case actions = "Actions"
            case description = "Description"
            case effect = "Effect"
            case ipRanges = "IpRanges"
            case name = "Name"
            case notActions = "NotActions"
            case notIpRanges = "NotIpRanges"
            case notUserIds = "NotUserIds"
            case organizationId = "OrganizationId"
            case userIds = "UserIds"
        }
    }

    public struct PutAccessControlRuleResponse: AWSDecodableShape {
        public init() {}
    }

    public struct PutMailboxPermissionsRequest: AWSEncodableShape {
        /// The identifier of the user, group, or resource for which to update mailbox permissions.
        public let entityId: String
        /// The identifier of the user, group, or resource to which to grant the permissions.
        public let granteeId: String
        /// The identifier of the organization under which the user, group, or resource exists.
        public let organizationId: String
        /// The permissions granted to the grantee. SEND_AS allows the grantee to send email as the owner of the mailbox (the grantee is not mentioned on these emails). SEND_ON_BEHALF allows the grantee to send email on behalf of the owner of the mailbox (the grantee is not mentioned as the physical sender of these emails). FULL_ACCESS allows the grantee full access to the mailbox, irrespective of other folder-level permissions set on the mailbox.
        public let permissionValues: [PermissionType]

        public init(entityId: String, granteeId: String, organizationId: String, permissionValues: [PermissionType]) {
            self.entityId = entityId
            self.granteeId = granteeId
            self.organizationId = organizationId
            self.permissionValues = permissionValues
        }

        public func validate(name: String) throws {
            try self.validate(self.entityId, name: "entityId", parent: name, max: 256)
            try self.validate(self.entityId, name: "entityId", parent: name, min: 12)
            try self.validate(self.granteeId, name: "granteeId", parent: name, max: 256)
            try self.validate(self.granteeId, name: "granteeId", parent: name, min: 12)
            try self.validate(self.organizationId, name: "organizationId", parent: name, max: 34)
            try self.validate(self.organizationId, name: "organizationId", parent: name, min: 34)
            try self.validate(self.organizationId, name: "organizationId", parent: name, pattern: "^m-[0-9a-f]{32}$")
        }

        private enum CodingKeys: String, CodingKey {
            case entityId = "EntityId"
            case granteeId = "GranteeId"
            case organizationId = "OrganizationId"
            case permissionValues = "PermissionValues"
        }
    }

    public struct PutMailboxPermissionsResponse: AWSDecodableShape {
        public init() {}
    }

    public struct PutRetentionPolicyRequest: AWSEncodableShape {
        /// The retention policy description.
        public let description: String?
        /// The retention policy folder configurations.
        public let folderConfigurations: [FolderConfiguration]
        /// The retention policy ID.
        public let id: String?
        /// The retention policy name.
        public let name: String
        /// The organization ID.
        public let organizationId: String

        public init(description: String? = nil, folderConfigurations: [FolderConfiguration], id: String? = nil, name: String, organizationId: String) {
            self.description = description
            self.folderConfigurations = folderConfigurations
            self.id = id
            self.name = name
            self.organizationId = organizationId
        }

        public func validate(name: String) throws {
            try self.validate(self.description, name: "description", parent: name, max: 256)
            try self.validate(self.description, name: "description", parent: name, pattern: "[\\w\\d\\s\\S\\-!?=,.;:'_]+")
            try self.folderConfigurations.forEach {
                try $0.validate(name: "\(name).folderConfigurations[]")
            }
            try self.validate(self.id, name: "id", parent: name, max: 64)
            try self.validate(self.id, name: "id", parent: name, min: 1)
            try self.validate(self.id, name: "id", parent: name, pattern: "[a-zA-Z0-9_-]+")
            try self.validate(self.name, name: "name", parent: name, max: 64)
            try self.validate(self.name, name: "name", parent: name, min: 1)
            try self.validate(self.name, name: "name", parent: name, pattern: "[a-zA-Z0-9_-]+")
            try self.validate(self.organizationId, name: "organizationId", parent: name, max: 34)
            try self.validate(self.organizationId, name: "organizationId", parent: name, min: 34)
            try self.validate(self.organizationId, name: "organizationId", parent: name, pattern: "^m-[0-9a-f]{32}$")
        }

        private enum CodingKeys: String, CodingKey {
            case description = "Description"
            case folderConfigurations = "FolderConfigurations"
            case id = "Id"
            case name = "Name"
            case organizationId = "OrganizationId"
        }
    }

    public struct PutRetentionPolicyResponse: AWSDecodableShape {
        public init() {}
    }

    public struct RegisterToWorkMailRequest: AWSEncodableShape {
        /// The email for the user, group, or resource to be updated.
        public let email: String
        /// The identifier for the user, group, or resource to be updated.
        public let entityId: String
        /// The identifier for the organization under which the user, group, or resource exists.
        public let organizationId: String

        public init(email: String, entityId: String, organizationId: String) {
            self.email = email
            self.entityId = entityId
            self.organizationId = organizationId
        }

        public func validate(name: String) throws {
            try self.validate(self.email, name: "email", parent: name, max: 254)
            try self.validate(self.email, name: "email", parent: name, min: 1)
            try self.validate(self.email, name: "email", parent: name, pattern: "[a-zA-Z0-9._%+-]{1,64}@[a-zA-Z0-9.-]+\\.[a-zA-Z-]{2,}")
            try self.validate(self.entityId, name: "entityId", parent: name, max: 256)
            try self.validate(self.entityId, name: "entityId", parent: name, min: 12)
            try self.validate(self.organizationId, name: "organizationId", parent: name, max: 34)
            try self.validate(self.organizationId, name: "organizationId", parent: name, min: 34)
            try self.validate(self.organizationId, name: "organizationId", parent: name, pattern: "^m-[0-9a-f]{32}$")
        }

        private enum CodingKeys: String, CodingKey {
            case email = "Email"
            case entityId = "EntityId"
            case organizationId = "OrganizationId"
        }
    }

    public struct RegisterToWorkMailResponse: AWSDecodableShape {
        public init() {}
    }

    public struct ResetPasswordRequest: AWSEncodableShape {
        /// The identifier of the organization that contains the user for which the password is reset.
        public let organizationId: String
        /// The new password for the user.
        public let password: String
        /// The identifier of the user for whom the password is reset.
        public let userId: String

        public init(organizationId: String, password: String, userId: String) {
            self.organizationId = organizationId
            self.password = password
            self.userId = userId
        }

        public func validate(name: String) throws {
            try self.validate(self.organizationId, name: "organizationId", parent: name, max: 34)
            try self.validate(self.organizationId, name: "organizationId", parent: name, min: 34)
            try self.validate(self.organizationId, name: "organizationId", parent: name, pattern: "^m-[0-9a-f]{32}$")
            try self.validate(self.password, name: "password", parent: name, max: 256)
            try self.validate(self.password, name: "password", parent: name, pattern: "[\\u0020-\\u00FF]+")
            try self.validate(self.userId, name: "userId", parent: name, max: 256)
            try self.validate(self.userId, name: "userId", parent: name, min: 12)
        }

        private enum CodingKeys: String, CodingKey {
            case organizationId = "OrganizationId"
            case password = "Password"
            case userId = "UserId"
        }
    }

    public struct ResetPasswordResponse: AWSDecodableShape {
        public init() {}
    }

    public struct Resource: AWSDecodableShape {
        /// The date indicating when the resource was disabled from Amazon WorkMail use.
        public let disabledDate: Date?
        /// The email of the resource.
        public let email: String?
        /// The date indicating when the resource was enabled for Amazon WorkMail use.
        public let enabledDate: Date?
        /// The identifier of the resource.
        public let id: String?
        /// The name of the resource.
        public let name: String?
        /// The state of the resource, which can be ENABLED, DISABLED, or DELETED.
        public let state: EntityState?
        /// The type of the resource: equipment or room.
        public let type: ResourceType?

        public init(disabledDate: Date? = nil, email: String? = nil, enabledDate: Date? = nil, id: String? = nil, name: String? = nil, state: EntityState? = nil, type: ResourceType? = nil) {
            self.disabledDate = disabledDate
            self.email = email
            self.enabledDate = enabledDate
            self.id = id
            self.name = name
            self.state = state
            self.type = type
        }

        private enum CodingKeys: String, CodingKey {
            case disabledDate = "DisabledDate"
            case email = "Email"
            case enabledDate = "EnabledDate"
            case id = "Id"
            case name = "Name"
            case state = "State"
            case type = "Type"
        }
    }

    public struct StartMailboxExportJobRequest: AWSEncodableShape {
        /// The idempotency token for the client request.
        public let clientToken: String
        /// The mailbox export job description.
        public let description: String?
        /// The identifier of the user or resource associated with the mailbox.
        public let entityId: String
        /// The Amazon Resource Name (ARN) of the symmetric AWS Key Management Service (AWS KMS) key that encrypts the exported mailbox content.
        public let kmsKeyArn: String
        /// The identifier associated with the organization.
        public let organizationId: String
        /// The ARN of the AWS Identity and Access Management (IAM) role that grants write permission to the S3 bucket.
        public let roleArn: String
        /// The name of the S3 bucket.
        public let s3BucketName: String
        /// The S3 bucket prefix.
        public let s3Prefix: String

        public init(clientToken: String = StartMailboxExportJobRequest.idempotencyToken(), description: String? = nil, entityId: String, kmsKeyArn: String, organizationId: String, roleArn: String, s3BucketName: String, s3Prefix: String) {
            self.clientToken = clientToken
            self.description = description
            self.entityId = entityId
            self.kmsKeyArn = kmsKeyArn
            self.organizationId = organizationId
            self.roleArn = roleArn
            self.s3BucketName = s3BucketName
            self.s3Prefix = s3Prefix
        }

        public func validate(name: String) throws {
            try self.validate(self.clientToken, name: "clientToken", parent: name, max: 128)
            try self.validate(self.clientToken, name: "clientToken", parent: name, min: 1)
            try self.validate(self.clientToken, name: "clientToken", parent: name, pattern: "[\\x21-\\x7e]+")
            try self.validate(self.description, name: "description", parent: name, max: 1023)
            try self.validate(self.description, name: "description", parent: name, min: 0)
            try self.validate(self.description, name: "description", parent: name, pattern: "[\\S\\s]*")
            try self.validate(self.entityId, name: "entityId", parent: name, max: 256)
            try self.validate(self.entityId, name: "entityId", parent: name, min: 12)
            try self.validate(self.kmsKeyArn, name: "kmsKeyArn", parent: name, max: 2048)
            try self.validate(self.kmsKeyArn, name: "kmsKeyArn", parent: name, min: 20)
            try self.validate(self.kmsKeyArn, name: "kmsKeyArn", parent: name, pattern: "arn:aws:kms:[a-z0-9-]*:[a-z0-9-]+:[A-Za-z0-9][A-Za-z0-9:_/+=,@.-]{0,1023}")
            try self.validate(self.organizationId, name: "organizationId", parent: name, max: 34)
            try self.validate(self.organizationId, name: "organizationId", parent: name, min: 34)
            try self.validate(self.organizationId, name: "organizationId", parent: name, pattern: "^m-[0-9a-f]{32}$")
            try self.validate(self.roleArn, name: "roleArn", parent: name, max: 2048)
            try self.validate(self.roleArn, name: "roleArn", parent: name, min: 20)
            try self.validate(self.s3BucketName, name: "s3BucketName", parent: name, max: 63)
            try self.validate(self.s3BucketName, name: "s3BucketName", parent: name, min: 1)
            try self.validate(self.s3BucketName, name: "s3BucketName", parent: name, pattern: "[A-Za-z0-9.-]+")
            try self.validate(self.s3Prefix, name: "s3Prefix", parent: name, max: 1023)
            try self.validate(self.s3Prefix, name: "s3Prefix", parent: name, min: 1)
            try self.validate(self.s3Prefix, name: "s3Prefix", parent: name, pattern: "[A-Za-z0-9!_.*'()/-]+")
        }

        private enum CodingKeys: String, CodingKey {
            case clientToken = "ClientToken"
            case description = "Description"
            case entityId = "EntityId"
            case kmsKeyArn = "KmsKeyArn"
            case organizationId = "OrganizationId"
            case roleArn = "RoleArn"
            case s3BucketName = "S3BucketName"
            case s3Prefix = "S3Prefix"
        }
    }

    public struct StartMailboxExportJobResponse: AWSDecodableShape {
        /// The job ID.
        public let jobId: String?

        public init(jobId: String? = nil) {
            self.jobId = jobId
        }

        private enum CodingKeys: String, CodingKey {
            case jobId = "JobId"
        }
    }

    public struct Tag: AWSEncodableShape & AWSDecodableShape {
        /// The key of the tag.
        public let key: String
        /// The value of the tag.
        public let value: String

        public init(key: String, value: String) {
            self.key = key
            self.value = value
        }

        public func validate(name: String) throws {
            try self.validate(self.key, name: "key", parent: name, max: 128)
            try self.validate(self.key, name: "key", parent: name, min: 1)
            try self.validate(self.value, name: "value", parent: name, max: 256)
            try self.validate(self.value, name: "value", parent: name, min: 0)
        }

        private enum CodingKeys: String, CodingKey {
            case key = "Key"
            case value = "Value"
        }
    }

    public struct TagResourceRequest: AWSEncodableShape {
        /// The resource ARN.
        public let resourceARN: String
        /// The tag key-value pairs.
        public let tags: [Tag]

        public init(resourceARN: String, tags: [Tag]) {
            self.resourceARN = resourceARN
            self.tags = tags
        }

        public func validate(name: String) throws {
            try self.validate(self.resourceARN, name: "resourceARN", parent: name, max: 1011)
            try self.validate(self.resourceARN, name: "resourceARN", parent: name, min: 1)
            try self.tags.forEach {
                try $0.validate(name: "\(name).tags[]")
            }
            try self.validate(self.tags, name: "tags", parent: name, max: 50)
            try self.validate(self.tags, name: "tags", parent: name, min: 0)
        }

        private enum CodingKeys: String, CodingKey {
            case resourceARN = "ResourceARN"
            case tags = "Tags"
        }
    }

    public struct TagResourceResponse: AWSDecodableShape {
        public init() {}
    }

    public struct UntagResourceRequest: AWSEncodableShape {
        /// The resource ARN.
        public let resourceARN: String
        /// The tag keys.
        public let tagKeys: [String]

        public init(resourceARN: String, tagKeys: [String]) {
            self.resourceARN = resourceARN
            self.tagKeys = tagKeys
        }

        public func validate(name: String) throws {
            try self.validate(self.resourceARN, name: "resourceARN", parent: name, max: 1011)
            try self.validate(self.resourceARN, name: "resourceARN", parent: name, min: 1)
            try self.tagKeys.forEach {
                try validate($0, name: "tagKeys[]", parent: name, max: 128)
                try validate($0, name: "tagKeys[]", parent: name, min: 1)
            }
            try self.validate(self.tagKeys, name: "tagKeys", parent: name, max: 50)
            try self.validate(self.tagKeys, name: "tagKeys", parent: name, min: 0)
        }

        private enum CodingKeys: String, CodingKey {
            case resourceARN = "ResourceARN"
            case tagKeys = "TagKeys"
        }
    }

    public struct UntagResourceResponse: AWSDecodableShape {
        public init() {}
    }

    public struct UpdateMailboxQuotaRequest: AWSEncodableShape {
        /// The updated mailbox quota, in MB, for the specified user.
        public let mailboxQuota: Int
        /// The identifier for the organization that contains the user for whom to update the mailbox quota.
        public let organizationId: String
        /// The identifer for the user for whom to update the mailbox quota.
        public let userId: String

        public init(mailboxQuota: Int, organizationId: String, userId: String) {
            self.mailboxQuota = mailboxQuota
            self.organizationId = organizationId
            self.userId = userId
        }

        public func validate(name: String) throws {
            try self.validate(self.mailboxQuota, name: "mailboxQuota", parent: name, min: 1)
            try self.validate(self.organizationId, name: "organizationId", parent: name, max: 34)
            try self.validate(self.organizationId, name: "organizationId", parent: name, min: 34)
            try self.validate(self.organizationId, name: "organizationId", parent: name, pattern: "^m-[0-9a-f]{32}$")
            try self.validate(self.userId, name: "userId", parent: name, max: 256)
            try self.validate(self.userId, name: "userId", parent: name, min: 12)
        }

        private enum CodingKeys: String, CodingKey {
            case mailboxQuota = "MailboxQuota"
            case organizationId = "OrganizationId"
            case userId = "UserId"
        }
    }

    public struct UpdateMailboxQuotaResponse: AWSDecodableShape {
        public init() {}
    }

    public struct UpdatePrimaryEmailAddressRequest: AWSEncodableShape {
        /// The value of the email to be updated as primary.
        public let email: String
        /// The user, group, or resource to update.
        public let entityId: String
        /// The organization that contains the user, group, or resource to update.
        public let organizationId: String

        public init(email: String, entityId: String, organizationId: String) {
            self.email = email
            self.entityId = entityId
            self.organizationId = organizationId
        }

        public func validate(name: String) throws {
            try self.validate(self.email, name: "email", parent: name, max: 254)
            try self.validate(self.email, name: "email", parent: name, min: 1)
            try self.validate(self.email, name: "email", parent: name, pattern: "[a-zA-Z0-9._%+-]{1,64}@[a-zA-Z0-9.-]+\\.[a-zA-Z-]{2,}")
            try self.validate(self.entityId, name: "entityId", parent: name, max: 256)
            try self.validate(self.entityId, name: "entityId", parent: name, min: 12)
            try self.validate(self.organizationId, name: "organizationId", parent: name, max: 34)
            try self.validate(self.organizationId, name: "organizationId", parent: name, min: 34)
            try self.validate(self.organizationId, name: "organizationId", parent: name, pattern: "^m-[0-9a-f]{32}$")
        }

        private enum CodingKeys: String, CodingKey {
            case email = "Email"
            case entityId = "EntityId"
            case organizationId = "OrganizationId"
        }
    }

    public struct UpdatePrimaryEmailAddressResponse: AWSDecodableShape {
        public init() {}
    }

    public struct UpdateResourceRequest: AWSEncodableShape {
        /// The resource's booking options to be updated.
        public let bookingOptions: BookingOptions?
        /// The name of the resource to be updated.
        public let name: String?
        /// The identifier associated with the organization for which the resource is updated.
        public let organizationId: String
        /// The identifier of the resource to be updated.
        public let resourceId: String

        public init(bookingOptions: BookingOptions? = nil, name: String? = nil, organizationId: String, resourceId: String) {
            self.bookingOptions = bookingOptions
            self.name = name
            self.organizationId = organizationId
            self.resourceId = resourceId
        }

        public func validate(name: String) throws {
            try self.validate(self.name, name: "name", parent: name, max: 20)
            try self.validate(self.name, name: "name", parent: name, min: 1)
            try self.validate(self.name, name: "name", parent: name, pattern: "[\\w\\-.]+(@[a-zA-Z0-9.\\-]+\\.[a-zA-Z0-9-]{2,})?")
            try self.validate(self.organizationId, name: "organizationId", parent: name, max: 34)
            try self.validate(self.organizationId, name: "organizationId", parent: name, min: 34)
            try self.validate(self.organizationId, name: "organizationId", parent: name, pattern: "^m-[0-9a-f]{32}$")
            try self.validate(self.resourceId, name: "resourceId", parent: name, max: 34)
            try self.validate(self.resourceId, name: "resourceId", parent: name, min: 34)
            try self.validate(self.resourceId, name: "resourceId", parent: name, pattern: "^r-[0-9a-f]{32}$")
        }

        private enum CodingKeys: String, CodingKey {
            case bookingOptions = "BookingOptions"
            case name = "Name"
            case organizationId = "OrganizationId"
            case resourceId = "ResourceId"
        }
    }

    public struct UpdateResourceResponse: AWSDecodableShape {
        public init() {}
    }

    public struct User: AWSDecodableShape {
        /// The date indicating when the user was disabled from Amazon WorkMail use.
        public let disabledDate: Date?
        /// The display name of the user.
        public let displayName: String?
        /// The email of the user.
        public let email: String?
        /// The date indicating when the user was enabled for Amazon WorkMail use.
        public let enabledDate: Date?
        /// The identifier of the user.
        public let id: String?
        /// The name of the user.
        public let name: String?
        /// The state of the user, which can be ENABLED, DISABLED, or DELETED.
        public let state: EntityState?
        /// The role of the user.
        public let userRole: UserRole?

        public init(disabledDate: Date? = nil, displayName: String? = nil, email: String? = nil, enabledDate: Date? = nil, id: String? = nil, name: String? = nil, state: EntityState? = nil, userRole: UserRole? = nil) {
            self.disabledDate = disabledDate
            self.displayName = displayName
            self.email = email
            self.enabledDate = enabledDate
            self.id = id
            self.name = name
            self.state = state
            self.userRole = userRole
        }

        private enum CodingKeys: String, CodingKey {
            case disabledDate = "DisabledDate"
            case displayName = "DisplayName"
            case email = "Email"
            case enabledDate = "EnabledDate"
            case id = "Id"
            case name = "Name"
            case state = "State"
            case userRole = "UserRole"
        }
    }
}
